From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7F993BB81 for ; Mon, 13 Dec 2004 19:45:04 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBDIj3Cc009843 for ; Mon, 13 Dec 2004 19:45:03 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA10383 for ; Mon, 13 Dec 2004 19:45:03 +0100 (MET) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBDIj27w009838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 13 Dec 2004 19:45:03 +0100 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 849DA2001A; Mon, 13 Dec 2004 19:45:02 +0100 (CET) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09699-01-39; Mon, 13 Dec 2004 19:45:00 +0100 (CET) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 6F8732000B; Mon, 13 Dec 2004 19:45:00 +0100 (CET) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 617EE26E87; Mon, 13 Dec 2004 19:45:00 +0100 (CET) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 439E03CBC; Mon, 13 Dec 2004 19:45:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 1CBBA2D686; Mon, 13 Dec 2004 19:45:00 +0100 (CET) Date: Mon, 13 Dec 2004 19:44:59 +0100 (CET) From: Thomas Fischbacher To: skaller Cc: Jacques Garrigue , caml-list Subject: Re: [Caml-list] environment idiom In-Reply-To: <1102944153.2578.234.camel@pelican.wigram> Message-ID: References: <877e9a170412121844b633bb8@mail.gmail.com> <877e9a1704121218456af9df9@mail.gmail.com> <20041213.182117.79057361.garrigue@math.nagoya-u.ac.jp> <1102944153.2578.234.camel@pelican.wigram> X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at concorde with ID 41BDE32F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41BDE32E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 evidently:01 haskell:01 haskell:01 typeclass:01 subtleties:01 monadic:01 ...:98 ...:98 cip:98 cip:98 lambda:01 lambda:01 idiom:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > On Mon, 2004-12-13 at 21:20, Thomas Fischbacher wrote: > > > > Referential transparency is about the substitution of definitions. > > Evidently, x <- ... is _not_ a definition. > > But this is a bit circular. It is suspect to use the Haskell > definition of 'definition' and then say Haskell is referentially > transparent, a property depending on the definition of 'definition', > because you cannot apply that definition to any other language. Haskell differs from other languages in the one important point that Haskell definitions have all the properties of what a mathematician would call a definition (maybe mod typeclass subtleties). And this is what referential transparency is about: is the notion of "definition" that a programming language gives you just the same as that in mathematics or not? > C also has 'definitions' but they're not at all the same > as Haskell ones. Precisely. And they do not behave like mathematical definitions, so C is not reftransparent. > So when you're looking at monadic Haskell that contains > > x <- ... > > you can claim it isn't a definition.. but it surely > looks like one.. more precisely it looks like an assignment. Well, the C statement x=x+1; may also look like an equation to the uninitiated, but everyone would perhaps agree with me that this is just a misinterpretation of symbols. > However clearly the ST monad is sometimes useful.. > can you explain when that is? Good question... -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)