On Mon, Feb 28, 2011 at 1:09 PM, Florian Weimer <[email protected]> wrote: > * Sebastian Sylvan: > >> I think that if Haskell allows it, it's unlikely to be an issue even for >> purists. :-) > > Haskell has potential side effects at every pattern match, so it can > hardly be used as a reference point for purity. > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
Pattern-match failure resulting in _|_ is hardly a basis to say Haskell is 'impure', or dismiss Haskell's purity entirely if you ask me. On this basis, is it unreasonable to say all evaluation in Haskell has 'potential side effects', because _|_ is an inhabitant of every type? It probably isn't unreasonable to say that on such grounds, but it's not very useful as an observation either is it? Is a partially defined function still not referentially transparent, in that 'f x = f x' holds, even if there exists an x such that 'f x' in this case results in _|_ (ignoring the fact that all _|_ values are considered semantically equivalent)? I do not believe being a 'pure language' completely eschews the use of partial functions, but I could be wrong. If you wanted to complain, unsafePerformIO would have better deserved the pointing finger of disapproval. :) (And it has shown immense usefulness many times too I might add, despite being contrary to everything we stand for.) Partiality, as well as things like non-termination can commonly be considered 'effects' (and perhaps are without question considered so in the 'total function' view of the world,) but I believe in this case it may be grasping at straws a little bit - I stand that by Sebastian's assertion that the ST monad is a fine example of strictly local mutation hidden by a pure function, and that Rust doing the same is likely not going to upset all but those who have the most stringent definitions. -- Regards, Austin _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
