From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p089SncV029032 for ; Sat, 8 Jan 2011 10:28:49 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAGa9J03UGyoFkWdsb2JhbACDd5I+jg4WAQEBCQsREQMhrkyNPYRYdASKPoQG X-IronPort-AV: E=Sophos;i="4.60,293,1291590000"; d="asc'?vcf'?scan'208";a="86316591" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Jan 2011 10:28:43 +0100 Received: from Tocksi.local (unknown [78.240.16.62]) by smtp5-g21.free.fr (Postfix) with ESMTP id 43197D48002 for ; Sat, 8 Jan 2011 10:28:36 +0100 (CET) Message-ID: <4D282E3F.9000904@univ-savoie.fr> Date: Sat, 08 Jan 2011 10:28:31 +0100 From: Christophe Raffalli User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: caml-list@inria.fr References: <699537.6718.qm@web111509.mail.gq1.yahoo.com> <87vd20plpv.fsf@mid.deneb.enyo.de> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig02768636746E245BB22966EE" Subject: Re: [Caml-list] Purity and lazyness This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig02768636746E245BB22966EE Content-Type: multipart/mixed; boundary="------------070208020300050305000406" This is a multi-part message in MIME format. --------------070208020300050305000406 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > 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. There are two definition of "pure". 1=C2=B0) a purely functional language without any side effect (no exception or error) Haskell do have partial match allowed, producing a "bottom" value and it also have non terminating program. For this definition, I think there are no pure language except may be languages used in theorem prover where totality is a requirement. 2=C2=B0) enjoying referential transparency but alowwing side effects in a controlled way : you can list all possible side effects and have good way to predict them (the compiler warns you that side effect are possible). Actually very few language implement a termination checker to warn you about possible non terminating recursive definition in your code ... This means that currently non termination is not really considered as a side effect which allows to say that haskell is "pure" for the second definition. Cheers, Christophe --=20 Christophe Raffalli Universite de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tel: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution=20 can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- --------------070208020300050305000406 Content-Type: text/x-vcard; charset=utf-8; name="Christophe_Raffalli.vcf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Christophe_Raffalli.vcf" YmVnaW46dmNhcmQNCmZuOkNocmlzdG9waGUgUmFmZmFsbGkNCm46UmFmZmFs bGk7Q2hyaXN0b3BoZQ0Kb3JnOkxBTUEgKFVNUiA1MTI3KQ0KZW1haWw7aW50 ZXJuZXQ6Y2hyaXN0b3BoZS5yYWZmYWxsaUB1bml2LXNhdm9pZS5mcg0KdGl0 bGU7cXVvdGVkLXByaW50YWJsZTpNYT1DMz1BRXRyZSBkZSBjb25mPUMzPUE5 cmVuY2VzDQp0ZWw7d29yazorMzMgNCA3OSA3NSA4MSAwMw0Kbm90ZTpodHRw Oi8vd3d3LmxhbWEudW5pdi1zYXZvaWUuZnIvfnJhZmZhbGxpDQp4LW1vemls bGEtaHRtbDpUUlVFDQp2ZXJzaW9uOjIuMQ0KZW5kOnZjYXJkDQoNCg== --------------070208020300050305000406-- --------------enig02768636746E245BB22966EE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFNKC5Ci9jr/RgYAS4RAjYtAJ95T9TQXqqw/QCfFFAzYAWc76cv7QCfagMN KkIns4REs+ljj5BNR0/yEyE= =d2SX -----END PGP SIGNATURE----- --------------enig02768636746E245BB22966EE--