[Haskell-cafe] Hash table constructors return table in IO Monad. Why?

michael rice nowgate at yahoo.com
Thu May 12 17:35:48 CEST 2011

Is there some reason why ALL the ways to create a hash table return one in the IO Monad, but all the functions for retrieving a value from a hash table take as an argument a hash table NOT in the IO Monad?
Prelude Data.HashTable> let ht = fromList id [(5,'a'),(6,'b')]Prelude Data.HashTable> fmap ((flip Data.HashTable.lookup) 6) htPrelude Data.HashTable>
Prelude Data.HashTable> :t fmap ((flip Data.HashTable.lookup) 6) htfmap ((flip Data.HashTable.lookup) 6) ht :: IO (IO (Maybe Char))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110512/4935d48d/attachment.htm>

More information about the Haskell-Cafe mailing list