summaryrefslogtreecommitdiff
path: root/compiler/simplCore
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2018-11-10 01:12:52 +0100
committerBen Gamari <ben@smart-cactus.org>2019-03-22 10:34:51 -0400
commitab51bee40c82cd552bcf13e24b67d43f3b8d25f3 (patch)
treea75a4102576dad50af44e342fb9152e7270792eb /compiler/simplCore
parentcd07086ada34888c08585f4dc98a961618748ed0 (diff)
downloadhaskell-ab51bee40c82cd552bcf13e24b67d43f3b8d25f3.tar.gz
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail Coauthored-by: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'compiler/simplCore')
-rw-r--r--compiler/simplCore/SimplCore.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index 7f2a0ea589..ade9816a1b 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -943,18 +943,18 @@ shortOutIndirections binds
makeIndEnv :: [CoreBind] -> IndEnv
makeIndEnv binds
- = foldr add_bind emptyVarEnv binds
+ = foldl' add_bind emptyVarEnv binds
where
- add_bind :: CoreBind -> IndEnv -> IndEnv
- add_bind (NonRec exported_id rhs) env = add_pair (exported_id, rhs) env
- add_bind (Rec pairs) env = foldr add_pair env pairs
+ add_bind :: IndEnv -> CoreBind -> IndEnv
+ add_bind env (NonRec exported_id rhs) = add_pair env (exported_id, rhs)
+ add_bind env (Rec pairs) = foldl' add_pair env pairs
- add_pair :: (Id,CoreExpr) -> IndEnv -> IndEnv
- add_pair (exported_id, exported) env
+ add_pair :: IndEnv -> (Id,CoreExpr) -> IndEnv
+ add_pair env (exported_id, exported)
| (ticks, Var local_id) <- stripTicksTop tickishFloatable exported
, shortMeOut env exported_id local_id
= extendVarEnv env local_id (exported_id, ticks)
- add_pair _ env = env
+ add_pair env _ = env
-----------------
shortMeOut :: IndEnv -> Id -> Id -> Bool