
+1
Sent from my iPhone
On May 30, 2010, at 8:51 PM, Felipe Lessa
On Sun, May 30, 2010 at 11:34:47PM +0100, Ian Lynagh wrote:
Hi all,
Currently, Data.Map.insertWith' (and friends) only force the value inserted when the combining function creates it:
Prelude Data.Map> insertWith' (+) "foo" undefined empty `seq` () () Prelude Data.Map> insertWith' (+) "foo" undefined (singleton "foo" 1) `seq` () *** Exception: Prelude.undefined
I think it would be more consistent for it to always force it:
Prelude Data.Map> insertWith' (+) "foo" undefined empty `seq` () *** Exception: Prelude.undefined Prelude Data.Map> insertWith' (+) "foo" undefined (singleton "foo" 1) `seq` () *** Exception: Prelude.undefined
The current behaviour is unexpected.
+1 for the patch.
-- Felipe. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries