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 3DED5BB81 for ; Mon, 13 Dec 2004 03:45:04 +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 iBD2j3kK021232 for ; Mon, 13 Dec 2004 03:45:03 +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 DAA11734 for ; Mon, 13 Dec 2004 03:45:03 +0100 (MET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.192]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBD2j2LT021228 for ; Mon, 13 Dec 2004 03:45:03 +0100 Received: by rproxy.gmail.com with SMTP id r35so1053819rna for ; Sun, 12 Dec 2004 18:45:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=tKG6YvcBM7ZMqb52fMKqifcyxdMkXQqjELltyXb9eJnDM+sa69zi+TBvd7DrIROF2xeBT+zRJjo4z2IwIBOtuHa8ccSqdyD1SEXP3H4Q+g24XLEY5GcXzzG6UuPpLsXudK2ldUl43JdUkp6LsakCoF/hVuIQlFdVxOSkEiW8KLE= Received: by 10.38.90.75 with SMTP id n75mr2550528rnb; Sun, 12 Dec 2004 18:45:02 -0800 (PST) Received: by 10.38.86.10 with HTTP; Sun, 12 Dec 2004 18:45:02 -0800 (PST) Message-ID: <877e9a1704121218456af9df9@mail.gmail.com> Date: Sun, 12 Dec 2004 21:45:02 -0500 From: Michael Walter Reply-To: Michael Walter To: caml-list Subject: [Caml-list] environment idiom In-Reply-To: <877e9a170412121844b633bb8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <9410EC84C0872141B27A2726613EF45D02A52E08@psmrdcex01.psm.pin.safeco.com> <20041211181313.GA9656@fichte.ai.univie.ac.at> <1102809398.2611.637.camel@pelican.wigram> <20041212023636.GA12724@force.stwing.upenn.edu> <1102829608.2768.77.camel@pelican.wigram> <877e9a170412121109ec02d44@mail.gmail.com> <1102898935.2768.88.camel@pelican.wigram> <877e9a17041212180365f76e4a@mail.gmail.com> <877e9a170412121805295e4704@mail.gmail.com> <877e9a170412121844b633bb8@mail.gmail.com> X-Miltered: at nez-perce with ID 41BD022F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41BD022E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 monadic:01 invocation:01 invocation:01 syntax:01 semantics:01 noticable:01 cheers:01 idiom:01 unsafe:01 purely:02 functional:02 encoding:02 namely:03 programming:03 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=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: > The claims that monadic programming allows side effect > free transparent purely functional encoding is unquestionably > bogus. In your view, would claiming that the stream approach allowed that be bogus as well? main :: [Response] -> [Request] In a pure language, main is obviously pure as well. And still, _given the proper "invocation" from an impure language_, it allows for I/O. To paraphrase: Does the mere existance of a "magic main invocation" (whether a streaming-main or an IO monadic-main) make a language impure, in your concept? To stretch it further: Suppose an interpreter for an language X with the simple syntax: X-program := (identifier-name '=' integer-literal)+ and semantics that the value of the identifier with the name "main" is print. It is not allowed to redefine existing definitions (i.e. mutate state). Hence every "program" in X is pure, but still an X program such as "main=42" will have a noticable side effect (namely, printing 42 on the screen). How can that be? <0.5-wink> Again I believe we are talking about different kinds of "purity". Thomas is obviously right in that the StateTransformer monad (modulo unsafe conversions) is pure, you are obviously right in the (different) point that _running_ an IO fragment has side effects. Generally, I'm not sure whether it's sensible to qualify other people's statements as "unquestionably bogus". Everything is relative :) Cheers, Michael