[Haskell-beginners] Why is there no notion of a one-tuple
(e.g., a '([])' as opposed to a '[]') in Haskell?
ajb at spamcop.net
ajb at spamcop.net
Thu Sep 25 01:11:57 EDT 2008
G'day all.
Quoting Ben Lippmeier <Ben.Lippmeier at anu.edu.au>:
>> Perhaps more crucially, it's hard to see where such a thing would
>> be useful.
>
> IORef, and ML's ref types are sort of one element tuples.
I used to do a fair bit of hash consing myself. I'm definitely sold on
references.
But they're not quite the same thing as 1-tuples. The fact that you need
to go through a monad in Haskell shows why they are different.
Cheers,
Andrew Bromage
More information about the Beginners
mailing list