caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Purity and lazyness
Date: Sat, 08 Jan 2011 10:28:31 +0100	[thread overview]
Message-ID: <4D282E3F.9000904@univ-savoie.fr> (raw)
In-Reply-To: <AANLkTinEcZcudWMjWH6C9+PR9m1mahD8+ynqfmPNw+GV@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1825 bytes --]


> 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°) 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°) 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

-- 
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 
can check this signature. The public key is
stored on www.keyserver.net
---------------------------------------------


[-- Attachment #1.2: Christophe_Raffalli.vcf --]
[-- Type: text/x-vcard, Size: 310 bytes --]

begin:vcard
fn:Christophe Raffalli
n:Raffalli;Christophe
org:LAMA (UMR 5127)
email;internet:christophe.raffalli@univ-savoie.fr
title;quoted-printable:Ma=C3=AEtre de conf=C3=A9rences
tel;work:+33 4 79 75 81 03
note:http://www.lama.univ-savoie.fr/~raffalli
x-mozilla-html:TRUE
version:2.1
end:vcard


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2011-01-08  9:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 15:35 Dario Teixeira
2011-01-07 16:07 ` Damien Doligez
2011-01-07 16:38   ` David Rajchenbach-Teller
2011-01-07 18:16     ` Holger Weiß
2011-01-07 20:22     ` Eray Ozkural
2011-01-07 20:29       ` orbitz
2011-01-07 20:30         ` Joel Reymont
2011-01-07 20:33         ` Eray Ozkural
2011-01-08  9:44     ` Jesper Louis Andersen
2011-01-07 17:21 ` Alain Frisch
2011-01-07 17:46   ` Christophe Raffalli
2011-01-07 18:11 ` Holger Weiß
2011-01-07 18:52   ` Brian Hurt
2011-01-07 19:32     ` Petter Urkedal
2011-01-07 20:25     ` Eray Ozkural
2011-01-09 16:11     ` Jon Harrop
2011-01-10  6:27       ` Eray Ozkural
2011-01-07 19:17 ` Florian Weimer
     [not found]   ` <AANLkTikxCSQ+0XkOmSVDb3EWq_2oQ0pac3bDgc7f7jq+@mail.gmail.com>
2011-01-07 20:52     ` bluestorm
2011-01-09 16:15       ` Jon Harrop
2011-01-08  0:26   ` Elias Gabriel Amaral da Silva
2011-01-08  9:28     ` Christophe Raffalli [this message]
2011-01-08 22:47     ` Florian Weimer
2011-01-09 10:00       ` Petter Urkedal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D282E3F.9000904@univ-savoie.fr \
    --to=christophe.raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).