From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 24DF6BBAF for ; Tue, 22 Jul 2008 17:17:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwAAJCWhUhbucREo2dsb2JhbACSSgEBAQEBAQcFCAcRnUU X-IronPort-AV: E=Sophos;i="4.31,231,1215381600"; d="scan'208";a="13355251" Received: from post.literal.si ([91.185.196.68]) by mail2-smtp-roc.national.inria.fr with ESMTP; 22 Jul 2008 17:17:12 +0200 Received: from localhost (post.literal.si [91.185.196.68]) by post.literal.si (Postfix) with ESMTP id 1789210E499F; Tue, 22 Jul 2008 17:17:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at literal.si Received: from post.literal.si ([91.185.196.68]) by localhost (post.literal.si [91.185.196.68]) (amavisd-new, port 10024) with ESMTP id MHGcZ5VI0VNN; Tue, 22 Jul 2008 17:17:09 +0200 (CEST) Received: from [192.168.1.59] (78-2-155-98.adsl.net.t-com.hr [78.2.155.98]) by post.literal.si (Postfix) with ESMTP id 6B55210E47C3; Tue, 22 Jul 2008 17:17:09 +0200 (CEST) Message-ID: <4885F9F4.50001@andrej.com> Date: Tue, 22 Jul 2008 17:17:08 +0200 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: =?UTF-8?B?QXhlbCBQb2lnbsOp?= Cc: caml-list caml-list Subject: Re: [Caml-list] Disappointment References: <4b5157c30807211428r19ef9865n6a65e81ac2f5fe31@mail.gmail.com> <4885BCC5.6080802@soton.ac.uk> <5D9CA6BE-731F-45A7-A1CC-AF1DC0556314@iais.fraunhofer.de> In-Reply-To: <5D9CA6BE-731F-45A7-A1CC-AF1DC0556314@iais.fraunhofer.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; andrej:01 andrej:01 monads:01 computes:01 semantics:01 algebra:01 functor:01 wrote:01 defines:01 caml-list:01 functions:01 tuple:02 namely:02 let:03 let:03 Axel Poigné wrote: > Maybe computer scientists obfuscate. The mathematical concept of monads > however is dead simple (at least if interpreted in a world of sets): > > Let X be a set of values and let TX denote a set of "simple terms" over > these values. A "simple term" may be thought of as either "an operator > applied to a tuple of values" or "a value", e.g. "values" are 1,2,3,... > and "simple terms" are 3, +(3,5), ... > > Additionally to the "operator" T on sets there are two functions: > > - \eta: X -> TX that turns a value into a "simple term", e.g. \eta(3) = 3 > - \mu: TX -> X that computes the value of a "simple term", hence > defines the semantics, e.g. \mu(+(3,5)) = 8. > > (T, \eta, and \mu) form a monad if This is incorrect. You are describing some sort of a mutant between a monad and an algebra for a functor T. A monad T has a different \mu, namely a family of maps (one for each set X) \mu_X : T (T X) -> T X One such \mu takes a "simple term of simple terms over X" and flattens it to a "simple term over X". Andrej