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 7FB86BB81 for ; Mon, 13 Dec 2004 15:10:05 +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 iBDEA4vB023899 for ; Mon, 13 Dec 2004 15:10:05 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA00615 for ; Mon, 13 Dec 2004 15:10:04 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBDEA2o2023868 for ; Mon, 13 Dec 2004 15:10:03 +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 iBDE9v0r095773; Tue, 14 Dec 2004 00:39:58 +1030 (CST) Subject: Re: [Caml-list] environment idiom From: skaller Reply-To: skaller@users.sourceforge.net To: Jacques Garrigue Cc: Thomas.Fischbacher@Physik.Uni-Muenchen.DE, caml-list In-Reply-To: <20041213.210940.74758065.garrigue@math.nagoya-u.ac.jp> References: <20041213.182117.79057361.garrigue@math.nagoya-u.ac.jp> <20041213.210940.74758065.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain Message-Id: <1102946997.2578.282.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 14 Dec 2004 01:09:57 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41BDA2BC.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41BDA2BA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 monads:01 abstractions:01 computations:01 coinductive:01 terminate:01 monads:01 haskell:01 glebe:01 061:98 idiom:01 nsw:01 functions: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 23:09, Jacques Garrigue wrote: > From: Thomas Fischbacher > OK, so probably we almost agree. > Three days ago I was about to answer John that indeed he has a good > point, but he seems to ignore completely the other advantages of > monads, like the fact you can cleanly mix stateful code with pure > code, keeping the two separate. I'm ignoring them only in the sense this particular discussion isn't about that. > My real curiosity was about the kind of compositional abstractions one > would use with stateful computations. It seems to me that the presence > of state itself makes it more difficult to compose cleanly. I would contend that is just a lack of theoretical understanding of how to do stateful programming. If you consider streams, and more generally, coinductive types to be stateful, then you can look at a symmetrical integration of the two concepts in a programming language -- Google for Charity. The language is weak -- functions aren't first class and it isn't Turing complete, but on the flip side all Charity programs are sure to terminate. > While being no expert of > the question, this seems to be a tendency of monads: they are > so comfortable that they tend to pollute everything, diluting the > advantage of knowing exactly what is functional. But how can you stop > people from going the easy way? You already know the answer I suspect -- better theory. It's one thing, for example, to find an FP is easier to use, and then to learn the superior compositional properties are the reason, and they depend on transparency .. but another to finally see a *theoretical* account of why this is so. This makes it easier to calculate a good solution where previously it looked hard -- i.e. you can't stop people going the easy way, so make the right way easier :) [BTW: Isn't Haskell slated to get Arrows to replace monads?] -- 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