Skip to content

Commit 1c678cf

Browse files
committed
Fix redundant import warning for foldl'
1 parent 6daa65b commit 1c678cf

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

lib/Text/Regex/TDFA/NewDFA/Engine.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ import Data.Maybe(catMaybes)
3636
import Data.Monoid as Mon(Monoid(..))
3737
import qualified Data.IntSet as ISet(toAscList)
3838
import Data.Array.IArray((!))
39-
import Data.List(partition,sort,foldl',sortBy,groupBy)
39+
import Data.List(partition,sort,sortBy,groupBy)
40+
import qualified Data.List as List
4041
import Data.STRef(STRef,newSTRef,readSTRef,writeSTRef)
4142
import qualified Control.Monad.ST.Lazy as L(ST,runST,strictToLazyST)
4243
import qualified Control.Monad.ST.Strict as S(ST)
@@ -313,7 +314,7 @@ execMatch r@(Regex { regex_dfa = DFA {d_id=didIn,d_dt=dtIn}
313314
earlyWin <- readSTRef (mq_earliest winQ)
314315
if earlyWin < earlyStart
315316
then do
316-
winners <- fmap (foldl' (\ rest ws -> ws : rest) []) $
317+
winners <- fmap (List.foldl' (\ rest ws -> ws : rest) []) $
317318
getMQ earlyStart winQ
318319
writeSTRef storeNext (next s2 s1 did' dt' (succ offset) prev' input')
319320
mapM (tagsToGroupsST aGroups) winners
@@ -397,7 +398,7 @@ execMatch r@(Regex { regex_dfa = DFA {d_id=didIn,d_dt=dtIn}
397398
putMQ (WScratch newerPos) winQ
398399

399400
finalizeWinners = do
400-
winners <- fmap (foldl' (\ rest mqa -> mqa_ws mqa : rest) []) $
401+
winners <- fmap (List.foldl' (\ rest mqa -> mqa_ws mqa : rest) []) $
401402
readSTRef (mq_list winQ) -- reverses the winner list
402403
resetMQ winQ
403404
writeSTRef storeNext (return [])

lib/Text/Regex/TDFA/TDFA.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Data.IntMap.CharMap2(CharMap(..))
1818
import qualified Data.IntMap.CharMap2 as Map(empty)
1919
--import Data.IntSet(IntSet)
2020
import qualified Data.IntSet as ISet(empty,singleton,null)
21-
import Data.List(foldl')
21+
import qualified Data.List as List
2222
import qualified Data.Map (Map,empty,member,insert,elems)
2323
import Data.Sequence as S((|>),{-viewl,ViewL(..)-})
2424

@@ -165,7 +165,7 @@ dfaMap = seen (Data.Map.empty) where
165165
if i `Data.Map.member` old
166166
then old
167167
else let new = Data.Map.insert i d old
168-
in foldl' seen new (flattenDT dt)
168+
in List.foldl' seen new (flattenDT dt)
169169

170170
-- Get all trans_many states
171171
flattenDT :: DT -> [DFA]
@@ -223,7 +223,7 @@ bestTrans _ [] = err "bestTrans : There were no transition choose from!"
223223
bestTrans aTagOP (f:fs) | null fs = canonical f
224224
| otherwise = answer -- if null toDisplay then answer else trace toDisplay answer
225225
where
226-
answer = foldl' pick (canonical f) fs
226+
answer = List.foldl' pick (canonical f) fs
227227
{- toDisplay | null fs = ""
228228
| otherwise = unlines $ "bestTrans" : show (answer) : "from among" : concatMap (\x -> [show x, show (toInstructions (snd x))]) (f:fs) -}
229229
canonical :: TagCommand -> (DoPa,Instructions)

lib/Text/Regex/TDFA/TNFA.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import Control.Monad(when)
4040
import Control.Monad.State(State,runState,execState,get,put,modify)
4141
import Data.Array.IArray(Array,array)
4242
import Data.Char(toLower,toUpper,isAlpha,ord)
43-
import Data.List(foldl')
43+
import qualified Data.List as List
4444
import Data.IntMap (IntMap)
4545
import qualified Data.IntMap as IMap(toAscList,null,unionWith,singleton,fromList,fromDistinctAscList)
4646
import Data.IntMap.CharMap2(CharMap(..))
@@ -139,15 +139,15 @@ listTestInfo qt s = execState (helper qt) s
139139
-- processing Or.
140140
applyNullViews :: NullView -> QT -> QT
141141
applyNullViews [] win = win
142-
applyNullViews nvs win = foldl' (dominate win) qtlose (reverse $ cleanNullView nvs) where
142+
applyNullViews nvs win = List.foldl' (dominate win) qtlose (reverse $ cleanNullView nvs)
143143

144144
-- This is used to prefer to view "win" through NullView. Losing is
145145
-- replaced by the plain win. This is employed by Star patterns to
146146
-- express that the first iteration is allowed to match null, but
147147
-- skipping the NullView occurs if the match fails.
148148
preferNullViews :: NullView -> QT -> QT
149149
preferNullViews [] win = win
150-
preferNullViews nvs win = foldl' (dominate win) win (reverse $ cleanNullView nvs) where
150+
preferNullViews nvs win = List.foldl' (dominate win) win (reverse $ cleanNullView nvs)
151151

152152
{-
153153
dominate is common to applyNullViews and preferNullViews above.

0 commit comments

Comments
 (0)