diff options
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Util.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index a8eb5ea471..41997178b4 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -80,7 +80,7 @@ module Util ( transitiveClosure, -- * Strictness - seqList, + seqList, strictMap, -- * Module names looksLikeModuleName, @@ -1008,6 +1008,14 @@ seqList :: [a] -> b -> b seqList [] b = b seqList (x:xs) b = x `seq` seqList xs b +strictMap :: (a -> b) -> [a] -> [b] +strictMap _ [] = [] +strictMap f (x : xs) = + let + !x' = f x + !xs' = strictMap f xs + in + x' : xs' {- ************************************************************************ |