summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Base.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2017-03-09 16:13:08 +0100
committerJoachim Breitner <mail@joachim-breitner.de>2017-03-09 16:13:08 +0100
commit665cefe80d112ed2e4fb9617d277a1466e83f9bd (patch)
tree0d68b9253c0467f3a0a072cec3b42bfcc9a48611 /libraries/base/GHC/Base.hs
parent3b40450436db1c927d88dbe7c6bad33f35dd4b1a (diff)
downloadhaskell-665cefe80d112ed2e4fb9617d277a1466e83f9bd.tar.gz
Add a comment to the mapFB rules
to amend 2fa44217c1d9722227297eefb0d6c6aed7e128ca.
Diffstat (limited to 'libraries/base/GHC/Base.hs')
-rw-r--r--libraries/base/GHC/Base.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 6f9d45469f..a678c22bbf 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -964,10 +964,12 @@ mapFB c f = \x ys -> c (f x) ys
-- (along with build's unfolding) else we'd get an infinite loop
-- in the rules. Hence the activation control below.
--
--- The "mapFB" rule optimises compositions of map.
---
-- This same pattern is followed by many other functions:
-- e.g. append, filter, iterate, repeat, etc.
+--
+-- The "mapFB" rule optimises compositions of map and
+-- the "mapFB/id" rule get rids of 'map id' calls.
+-- (Any similarity to the Functor laws for [] is expected.)
{-# RULES
"map" [~1] forall f xs. map f xs = build (\c n -> foldr (mapFB c f) n xs)