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