From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 547C5BB81 for ; Mon, 13 Dec 2004 11:53:54 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBDArr7Y021224 for ; Mon, 13 Dec 2004 11:53:53 +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 LAA26413 for ; Mon, 13 Dec 2004 11:53:53 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBDAroRj015288 for ; Mon, 13 Dec 2004 11:53:52 +0100 Received: from [192.168.1.200] (ppp209-112.lns2.syd3.internode.on.net [203.122.209.112]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBDAr80r086637; Mon, 13 Dec 2004 21:23:13 +1030 (CST) Subject: Re: [Caml-list] environment idiom From: skaller Reply-To: skaller@users.sourceforge.net To: Thomas Fischbacher Cc: Markus Mottl , Andrej Bauer , caml-list In-Reply-To: References: <9410EC84C0872141B27A2726613EF45D02A52E08@psmrdcex01.psm.pin.safeco.com> <41B97FD7.50309@andrej.com> <1102732237.2611.580.camel@pelican.wigram> <41BB04D8.60405@andrej.com> <20041211181313.GA9656@fichte.ai.univie.ac.at> <1102809398.2611.637.camel@pelican.wigram> <1102901206.2768.127.camel@pelican.wigram> Content-Type: text/plain Message-Id: <1102935187.2578.85.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 13 Dec 2004 21:53:08 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41BD74C1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41BD74BE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 monadic:01 haskell:01 monads:01 haskell:01 conditionals:01 glebe:01 ...:98 061:98 idiom:01 nsw:01 snail:02 2037:02 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 19:37, Thomas Fischbacher wrote: > I think you do not yet fully appreciate the key point concerning the > monadic approach. I think most of the theoreticians don't either. > Or in still other words: could you please show me a piece of haskell > code that uses monads but is not referentially transparent (assuming you > do not use "unofficial" features such as, in particular, unsafePerformIO)? I can't do enough Haskell yet, give me a few days :) Consider this language: Registers R0-R15,PC Three address form: R1=R2 op R3 Some conditionals .. I.e. a simplified Assembler. Is assmebler code functional? No of course not! Yes of course it is! Is is nothing more than a function from registers to registers where the instructions guarrantee you can't access the prior state. That's just the state monad .. :) The point really is: what do you mean by purely functional? I think the answer depends on context. I'm sure you can implement this machine using the ST monad... -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net