Chad Scherrer <chad.scherrer <at> gmail.com> writes:

> 
> A while back I was playing with Data.Map was getting irritated about
> lookups that fail having the type of values, but wrapped in an extra
> monad. I decided to work around this by putting a default in the data
> type itself, so we have a "functional map"
> 
> data FMap k a = FMap (k -> a) (Map k a)
...

Sorry to respond to my own message, but I think I might have figured it out.
This should be strict in the Map parameter, so this works better:

data FMap k a = FMap (k -> a) !(Map k a)

It still takes lots of memory for what I'm trying to do, but that's another
problem. At least the stack seems happy.

Chad

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to