[Haskell-cafe] Space questions about intern and sets

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Jun 1 08:23:25 EDT 2005


Gracjan Polak <gracjan at acchsh.com> writes:

> intern :: Ord a => a -> a
> intern x = unsafePerformIO $ internIO x
>
> iorefset :: Ord a => IORef(Map.Map a a)
> iorefset = unsafePerformIO $ do
>      newIORef $ Map.empty

It will not work because you can't put values of different types as
keys of the same dictionary, as you can't compare them.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list