[Haskell-cafe] Types and hashes of hashes, trouble for a Java-programmer...

John Smith smithsnorth at gmail.com
Mon Apr 13 12:53:50 EDT 2009


Yes, got the point. But is it not possible to "wrap IO inside IO" at
all? What would the program look like, just for the exercise?

On Mon, Apr 13, 2009 at 6:50 PM, Lennart Augustsson
<lennart at augustsson.net> wrote:
> No, removing IO is the right way.  There is no reason to involve IO for this.
>
>  -- Lennart
>
> On Mon, Apr 13, 2009 at 6:27 PM, John Smith <smithsnorth at gmail.com> wrote:
>> If you mean using a non-destructive map where the IO-problem is
>> absent, that is a doable thing. But it would be like cheating :-)
>>
>> What I try do do is something like:
>>
>> test = do
>>   h <- HashTable.new (==) (\key -> key)
>>   h1 <- HashTable.new (==) (\key -> key)
>>   HashTable.insert h 3 h1
>>   HashTable.insert h1 1 1000
>>   res <- case HashTable.lookup h 3 of
>>       Nothing -> Nothing
>>       Just outer -> HashTable.lookup outer 1000
>>   return res
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>


More information about the Haskell-Cafe mailing list