
12 May
2011
12 May
'11
11:35 a.m.
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? Michael ================= 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))