[commit: containers] master: Make findWithDefault strict in the default value (9e24a8b)

Ian Lynagh igloo at earth.li
Thu Feb 23 01:13:07 CET 2012


Repository : ssh://darcs.haskell.org//srv/darcs/packages/containers

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/9e24a8b3cea68c1161087872e3272af0305934da

>---------------------------------------------------------------

commit 9e24a8b3cea68c1161087872e3272af0305934da
Author: Johan Tibell <johan.tibell at gmail.com>
Date:   Thu Nov 17 21:30:53 2011 -0800

    Make findWithDefault strict in the default value

>---------------------------------------------------------------

 Data/Map/Strict.hs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Data/Map/Strict.hs b/Data/Map/Strict.hs
index d3a1545..edfc9af 100644
--- a/Data/Map/Strict.hs
+++ b/Data/Map/Strict.hs
@@ -286,7 +286,7 @@ import Data.Map.Base hiding
 -- > findWithDefault 'x' 5 (fromList [(5,'a'), (3,'b')]) == 'a'
 
 findWithDefault :: Ord k => a -> k -> Map k a -> a
-findWithDefault def k m = case lookup k m of
+findWithDefault !def k m = case lookup k m of
     Nothing -> def
     Just x  -> x
 #if __GLASGOW_HASKELL__ >= 700





More information about the Cvs-libraries mailing list