
At 23:25 09/11/04 +0100, Remi Turk wrote:
(I looked at Data.HashTable, but I couldn't figure why it needs to be implemented in the IO monad, except to optimize the internal implementation. Also, it's not clear to me how it behaves when a key is inserted that already exists.) A hash-table becomes rather useless without mutable state AFAICS. Without it, one might almost just as well use a list of pairs... Actually, some kind of freezeHashTable may be useful, and a HashTable in the ST monad is definitely useful: I guess patches are welcome..
I can see why using (something like) a state monad might be useful, but not why it needs to be an IO monad, unless there's some fairly low-down optimization being performed. (I'm not asking for this, BTW, just commenting on the apparent lack. For my application, I am using a list of pairs, as I expect these tables to be relatively small.) #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact