From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p080RN2e017204 for ; Sat, 8 Jan 2011 01:27:23 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoAAJs+J01KfVK2kGdsb2JhbACDd6A4CBUBAQEBCQkMBxEEIKRniTw8ghWEYC6FZQEBAwWBHIM3dASLCQ X-IronPort-AV: E=Sophos;i="4.60,292,1291590000"; d="scan'208";a="72586031" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Jan 2011 01:26:56 +0100 Received: by wyf19 with SMTP id 19so18510438wyf.27 for ; Fri, 07 Jan 2011 16:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+cC+A2CfsdhAjoYqB399gDxSK8Gzd3T7TAkYEZ0X/2s=; b=Noc4F4uAc60IhNoYAbs4BHmWCHlKps3LGP/DEMgdyXtuLdVUGB0bgYaFjswUFtSE4q 9IdPyvMlzelMSYJFlSqjh8yKKCM+40LOqaqlNe160NnXC1F3uTUuFbiWokFRR8tLoELi dyE0gvrEcO2dzIpJ8fxwytvjgOZWhgZILKr1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gssl7QewGvGUUKkTWkeq2q8LfX8JhH18/Ka34kOjI1NDAil6KFHvRcW2/A4akaeqsW ll9RpnJSHuDUAorXOKRZYxcFwDOC3rsYcf0eEoHRYwOgYMr9T6z5Pl+cQN1oZdmLRGzW GBXSbrXcAfc8smYFw2NsCrZVGCyn3cLpFeDrc= MIME-Version: 1.0 Received: by 10.227.128.4 with SMTP id i4mr16647681wbs.109.1294446416366; Fri, 07 Jan 2011 16:26:56 -0800 (PST) Received: by 10.216.154.204 with HTTP; Fri, 7 Jan 2011 16:26:56 -0800 (PST) In-Reply-To: <87vd20plpv.fsf@mid.deneb.enyo.de> References: <699537.6718.qm@web111509.mail.gq1.yahoo.com> <87vd20plpv.fsf@mid.deneb.enyo.de> Date: Fri, 7 Jan 2011 21:26:56 -0300 Message-ID: From: Elias Gabriel Amaral da Silva To: Florian Weimer Cc: Dario Teixeira , caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p080RN2e017204 Subject: Re: [Caml-list] Purity and lazyness 2011/1/7 Florian Weimer : > * Dario Teixeira: > >> So, my question is whether there is something I'm missing and in fact "purity >> <=> lazyness", or I am reading too much from those Haskeller presentations, >> because they never meant to say anything beyond "lazyness => purity", and >> freely mixing the two was just a casual oversight. > > As specified, Haskell is not a pure language because every pattern > match can have side effects.  The Haskell community is split between > those who think that this is a good thing, and those that consider it > problematic.  (Obviously, there is a large pure subset, much more > useful than Erlang's pure subset and covering almost the whole > language; you just avoid lazy I/O and use unsafePerformIO only for > correcting the type of functions imported through FFI.) Wait, a pattern match can have side effects? Can you provide some example code? (do you mean, pattern match failure / exceptions / run time errors?) I'm new to Haskell, but in my understanding, it is said that Haskell is pure because the whole Haskell code is just specification of (types, .. and) values, and this specification is enjoy referential transparency. One defines "main" to hold a certain value, which describe the computations that will performed at run time; but main is defined using compositions that preserve referential transparency (a >>= b has value a that depends only on a and b; and in general, f a b .. has a value that depends only on f, a, b, ..; I know no exception for this)