summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/codeGen/CgClosure.lhs2
-rw-r--r--compiler/codeGen/CgHeapery.lhs2
-rw-r--r--compiler/codeGen/CgMonad.lhs1
-rw-r--r--compiler/coreSyn/CoreSubst.lhs2
-rw-r--r--compiler/coreSyn/CoreTidy.lhs2
-rw-r--r--compiler/deSugar/DsArrows.lhs2
-rw-r--r--compiler/iface/BinIface.hs1
-rw-r--r--compiler/simplCore/CSE.lhs4
-rw-r--r--compiler/simplCore/OccurAnal.lhs4
-rw-r--r--compiler/simplCore/SimplEnv.lhs2
-rw-r--r--compiler/specialise/Rules.lhs2
-rw-r--r--compiler/stranal/DmdAnal.lhs4
-rw-r--r--compiler/typecheck/Inst.lhs2
-rw-r--r--compiler/typecheck/TcTyClsDecls.lhs2
-rw-r--r--compiler/types/Type.lhs1
-rw-r--r--compiler/utils/ListSetOps.lhs4
-rw-r--r--compiler/utils/Util.lhs57
17 files changed, 30 insertions, 64 deletions
diff --git a/compiler/codeGen/CgClosure.lhs b/compiler/codeGen/CgClosure.lhs
index 98e5b0d0f2..fabf434d07 100644
--- a/compiler/codeGen/CgClosure.lhs
+++ b/compiler/codeGen/CgClosure.lhs
@@ -46,6 +46,8 @@ import BasicTypes
import Constants
import Outputable
import FastString
+
+import Data.List
\end{code}
%********************************************************
diff --git a/compiler/codeGen/CgHeapery.lhs b/compiler/codeGen/CgHeapery.lhs
index 4a128499a7..3bba211aa1 100644
--- a/compiler/codeGen/CgHeapery.lhs
+++ b/compiler/codeGen/CgHeapery.lhs
@@ -45,6 +45,8 @@ import Util
import Constants
import PackageConfig
import Outputable
+
+import Data.List
\end{code}
diff --git a/compiler/codeGen/CgMonad.lhs b/compiler/codeGen/CgMonad.lhs
index 688591292c..8723e46d2a 100644
--- a/compiler/codeGen/CgMonad.lhs
+++ b/compiler/codeGen/CgMonad.lhs
@@ -79,6 +79,7 @@ import FastString
import Outputable
import Control.Monad
+import Data.List
infixr 9 `thenC` -- Right-associative!
infixr 9 `thenFC`
diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs
index 8306c04611..1c81d8859a 100644
--- a/compiler/coreSyn/CoreSubst.lhs
+++ b/compiler/coreSyn/CoreSubst.lhs
@@ -45,6 +45,8 @@ import Outputable
import PprCore () -- Instances
import Util
import FastTypes
+
+import Data.List
\end{code}
diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs
index 95c3ac45d3..ea89fcc187 100644
--- a/compiler/coreSyn/CoreTidy.lhs
+++ b/compiler/coreSyn/CoreTidy.lhs
@@ -26,6 +26,8 @@ import OccName
import SrcLoc
import Maybes
import Util
+
+import Data.List
\end{code}
diff --git a/compiler/deSugar/DsArrows.lhs b/compiler/deSugar/DsArrows.lhs
index fc2432d6fc..c44ed59243 100644
--- a/compiler/deSugar/DsArrows.lhs
+++ b/compiler/deSugar/DsArrows.lhs
@@ -42,6 +42,8 @@ import Util
import HsUtils
import VarSet
import SrcLoc
+
+import Data.List
\end{code}
\begin{code}
diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs
index 4664bf14ed..392873bbd9 100644
--- a/compiler/iface/BinIface.hs
+++ b/compiler/iface/BinIface.hs
@@ -34,6 +34,7 @@ import Config
import FastMutInt
import Outputable
+import Data.List
import Data.Word
import Data.Array
import Data.IORef
diff --git a/compiler/simplCore/CSE.lhs b/compiler/simplCore/CSE.lhs
index 39344fc477..782e564bb2 100644
--- a/compiler/simplCore/CSE.lhs
+++ b/compiler/simplCore/CSE.lhs
@@ -21,8 +21,10 @@ import CoreLint ( showPass, endPass )
import Outputable
import StaticFlags ( opt_PprStyle_Debug )
import BasicTypes ( isAlwaysActive )
-import Util ( mapAccumL, lengthExceeds )
+import Util ( lengthExceeds )
import UniqFM
+
+import Data.List
\end{code}
diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs
index dc20fd2d0b..ae2b7b9023 100644
--- a/compiler/simplCore/OccurAnal.lhs
+++ b/compiler/simplCore/OccurAnal.lhs
@@ -35,8 +35,10 @@ import Digraph ( stronglyConnCompR, SCC(..) )
import PrelNames ( buildIdKey, foldrIdKey, runSTRepIdKey, augmentIdKey )
import Unique ( Unique )
import UniqFM ( keysUFM, intersectsUFM )
-import Util ( mapAndUnzip, mapAccumL )
+import Util ( mapAndUnzip )
import Outputable
+
+import Data.List
\end{code}
diff --git a/compiler/simplCore/SimplEnv.lhs b/compiler/simplCore/SimplEnv.lhs
index 1d7d2e4420..6104d33901 100644
--- a/compiler/simplCore/SimplEnv.lhs
+++ b/compiler/simplCore/SimplEnv.lhs
@@ -58,6 +58,8 @@ import BasicTypes
import DynFlags
import Util
import Outputable
+
+import Data.List
\end{code}
%************************************************************************
diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs
index ed9f2388bc..26a499bfeb 100644
--- a/compiler/specialise/Rules.lhs
+++ b/compiler/specialise/Rules.lhs
@@ -45,7 +45,7 @@ import Maybes
import OrdList
import Bag
import Util
-import List hiding( mapAccumL ) -- Also defined in Util
+import Data.List
\end{code}
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index 4c5de9616f..84c189e56b 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -43,11 +43,13 @@ import UniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly,
import Type ( isUnLiftedType, coreEqType, splitTyConApp_maybe )
import Coercion ( coercionKind )
import CoreLint ( showPass, endPass )
-import Util ( mapAndUnzip, mapAccumL, mapAccumR, lengthIs )
+import Util ( mapAndUnzip, lengthIs )
import BasicTypes ( Arity, TopLevelFlag(..), isTopLevel, isNeverActive,
RecFlag(..), isRec )
import Maybes ( orElse, expectJust )
import Outputable
+
+import Data.List
\end{code}
To think about
diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs
index 962e4e08f3..6a09244372 100644
--- a/compiler/typecheck/Inst.lhs
+++ b/compiler/typecheck/Inst.lhs
@@ -76,6 +76,8 @@ import DynFlags
import Maybes
import Util
import Outputable
+
+import Data.List
\end{code}
diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs
index 8a07faeab8..3d2e4ba864 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -44,7 +44,7 @@ import ListSetOps
import Digraph
import DynFlags
-import Data.List ( partition, elemIndex )
+import Data.List
import Control.Monad ( mplus )
\end{code}
diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs
index 37f915be1d..649baea9f5 100644
--- a/compiler/types/Type.lhs
+++ b/compiler/types/Type.lhs
@@ -122,6 +122,7 @@ import Util
import Outputable
import UniqSet
+import Data.List
import Data.Maybe ( isJust )
\end{code}
diff --git a/compiler/utils/ListSetOps.lhs b/compiler/utils/ListSetOps.lhs
index becf9e6da2..29f4bb15f8 100644
--- a/compiler/utils/ListSetOps.lhs
+++ b/compiler/utils/ListSetOps.lhs
@@ -24,9 +24,9 @@ module ListSetOps (
import Outputable
import Unique ( Unique )
import UniqFM ( eltsUFM, emptyUFM, addToUFM_C )
-import Util ( isn'tIn, isIn, mapAccumR, sortLe )
+import Util ( isn'tIn, isIn, sortLe )
-import Data.List ( partition )
+import Data.List
\end{code}
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index abde6d65e6..1d7f7a4ee2 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -32,7 +32,6 @@ module Util (
transitiveClosure,
-- accumulating
- mapAccumL, mapAccumR, mapAccumB,
foldl2, count, all2,
takeList, dropList, splitAtList, split,
@@ -488,62 +487,6 @@ transitiveClosure succ eq xs
%* *
%************************************************************************
-@mapAccumL@ behaves like a combination
-of @map@ and @foldl@;
-it applies a function to each element of a list, passing an accumulating
-parameter from left to right, and returning a final value of this
-accumulator together with the new list.
-
-\begin{code}
-mapAccumL :: (acc -> x -> (acc, y)) -- Function of elt of input list
- -- and accumulator, returning new
- -- accumulator and elt of result list
- -> acc -- Initial accumulator
- -> [x] -- Input list
- -> (acc, [y]) -- Final accumulator and result list
-
-mapAccumL f b [] = (b, [])
-mapAccumL f b (x:xs) = (b'', x':xs') where
- (b', x') = f b x
- (b'', xs') = mapAccumL f b' xs
-\end{code}
-
-@mapAccumR@ does the same, but working from right to left instead. Its type is
-the same as @mapAccumL@, though.
-
-\begin{code}
-mapAccumR :: (acc -> x -> (acc, y)) -- Function of elt of input list
- -- and accumulator, returning new
- -- accumulator and elt of result list
- -> acc -- Initial accumulator
- -> [x] -- Input list
- -> (acc, [y]) -- Final accumulator and result list
-
-mapAccumR f b [] = (b, [])
-mapAccumR f b (x:xs) = (b'', x':xs') where
- (b'', x') = f b' x
- (b', xs') = mapAccumR f b xs
-\end{code}
-
-Here is the bi-directional version, that works from both left and right.
-
-\begin{code}
-mapAccumB :: (accl -> accr -> x -> (accl, accr,y))
- -- Function of elt of input list
- -- and accumulator, returning new
- -- accumulator and elt of result list
- -> accl -- Initial accumulator from left
- -> accr -- Initial accumulator from right
- -> [x] -- Input list
- -> (accl, accr, [y]) -- Final accumulators and result list
-
-mapAccumB f a b [] = (a,b,[])
-mapAccumB f a b (x:xs) = (a'',b'',y:ys)
- where
- (a',b'',y) = f a b' x
- (a'',b',ys) = mapAccumB f a' b xs
-\end{code}
-
A strict version of foldl.
\begin{code}