summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-11-01 11:21:49 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-05 11:39:13 -0500
commite6ffe148a17c93e05b410cb49bcc868f9d72c807 (patch)
tree8cdac5c0197ac1631cb5446b6960a69410b5aaea
parent1593debf54ab40708e1c1224c656752d4ccd1ffa (diff)
downloadhaskell-e6ffe148a17c93e05b410cb49bcc868f9d72c807.tar.gz
TidyPgm: replace an explicit loop with mapAccumL
-rw-r--r--compiler/main/TidyPgm.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index f0dbc6734b..ae491ac02d 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -63,7 +63,7 @@ import qualified ErrUtils as Err
import Control.Monad
import Data.Function
-import Data.List ( sortBy )
+import Data.List ( sortBy, mapAccumL )
import Data.IORef ( atomicModifyIORef' )
{-
@@ -1089,12 +1089,7 @@ tidyTopBinds hsc_env this_mod unfold_env init_occ_env binds
init_env = (init_occ_env, emptyVarEnv)
- tidy _ env [] = (env, [])
- tidy cvt_literal env (b:bs)
- = let (env1, b') = tidyTopBind dflags this_mod cvt_literal unfold_env
- env b
- (env2, bs') = tidy cvt_literal env1 bs
- in (env2, b':bs')
+ tidy cvt_literal = mapAccumL (tidyTopBind dflags this_mod cvt_literal unfold_env)
------------------------
tidyTopBind :: DynFlags