Commit 8100c58a authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Remove foldl' from Util; use the Data.List one instead

parent 407e1a2b
...@@ -64,6 +64,8 @@ import Outputable ...@@ -64,6 +64,8 @@ import Outputable
import GHC.Exts import GHC.Exts
import Data.List
#if ! OMIT_NATIVE_CODEGEN #if ! OMIT_NATIVE_CODEGEN
# define IF_NCG(a) a # define IF_NCG(a) a
#else #else
......
...@@ -42,7 +42,7 @@ module Util ( ...@@ -42,7 +42,7 @@ module Util (
removeSpaces, removeSpaces,
-- strictness -- strictness
foldl', seqList, seqList,
-- pairs -- pairs
unzipWith, unzipWith,
...@@ -487,16 +487,6 @@ transitiveClosure succ eq xs ...@@ -487,16 +487,6 @@ transitiveClosure succ eq xs
%* * %* *
%************************************************************************ %************************************************************************
A strict version of foldl.
\begin{code}
foldl' :: (a -> b -> a) -> a -> [b] -> a
foldl' f z xs = lgo z xs
where
lgo z [] = z
lgo z (x:xs) = (lgo $! (f z x)) xs
\end{code}
A combination of foldl with zip. It works with equal length lists. A combination of foldl with zip. It works with equal length lists.
\begin{code} \begin{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment