From 8100c58a929d993d2dd7022412ed6113cf97fba7 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 6 Jul 2007 20:54:10 +0000 Subject: [PATCH] Remove foldl' from Util; use the Data.List one instead --- compiler/utils/FiniteMap.lhs | 2 ++ compiler/utils/Util.lhs | 12 +----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/compiler/utils/FiniteMap.lhs b/compiler/utils/FiniteMap.lhs index 6ac6b09..50800bf 100644 --- a/compiler/utils/FiniteMap.lhs +++ b/compiler/utils/FiniteMap.lhs @@ -64,6 +64,8 @@ import Outputable import GHC.Exts +import Data.List + #if ! OMIT_NATIVE_CODEGEN # define IF_NCG(a) a #else diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 1d7f7a4..8473faf 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -42,7 +42,7 @@ module Util ( removeSpaces, -- strictness - foldl', seqList, + seqList, -- pairs unzipWith, @@ -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. \begin{code} -- 1.7.10.4