[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] FiniteMap-like module for unordered keys?
From:       Graham Klyne <gk () ninebynine ! org>
Date:       2004-11-10 10:53:37
Message-ID: 5.1.0.14.2.20041110105056.02bfbb10 () 127 ! 0 ! 0 ! 1
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic