[Haskell-cafe] is 256M RAM insufficient for a 20 millionelement Int/Int map?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Oct 20 00:40:01 EDT 2008


On Sun, 2008-10-19 at 16:05 -0700, Don Stewart wrote:

> I'd like them strict and specialised,
> 
> So that:
> 
>     data IntMap a = Nil
>                   | Tip {-# UNPACK #-} !Key a
>                   | Bin {-# UNPACK #-} !Prefix {-# UNPACK #-} !Mask !(IntMap a) !(IntMap a) 
> 
> applied as so,
> 
>     type T = IntMap {-# UNPACK #-} !Int

Yes, except that it should be newtype. That gives a proper boundary to
apply injection / projection functions for the different internal
representation.

Duncan



More information about the Haskell-Cafe mailing list