[Git][ghc/ghc][wip/buggymcbugfix/15185-enum-int] 2 commits: Fix spelling mistakes and typos
Vilem-Benjamin Liepelt
gitlab at gitlab.haskell.org
Mon May 11 22:06:46 UTC 2020
Vilem-Benjamin Liepelt pushed to branch wip/buggymcbugfix/15185-enum-int at Glasgow Haskell Compiler / GHC
Commits:
0214db8f by Vilem Liepelt at 2020-05-12T00:59:28+03:00
Fix spelling mistakes and typos
- - - - -
9cbab25f by Vilem Liepelt at 2020-05-12T01:06:00+03:00
Add inline pragmas to Enum methods
- - - - -
3 changed files:
- docs/users_guide/debugging.rst
- libraries/base/GHC/Enum.hs
- libraries/base/GHC/List.hs
Changes:
=====================================
docs/users_guide/debugging.rst
=====================================
@@ -301,7 +301,7 @@ subexpression elimination pass.
Rules are filtered by the user provided string, a rule is kept if a prefix
of its name matches the string.
The pass then checks whether any of these rules could apply to
- the program but which didn't file for some reason. For example, specifying
+ the program but which didn't fire for some reason. For example, specifying
``-drule-check=SPEC`` will check whether there are any applications which
might be subject to a rule created by specialisation.
=====================================
libraries/base/GHC/Enum.hs
=====================================
@@ -139,11 +139,22 @@ class Enum a where
-- * @enumFromThenTo 6 8 2 :: [Int] = []@
enumFromThenTo :: a -> a -> a -> [a]
- succ = toEnum . (+ 1) . fromEnum
- pred = toEnum . (subtract 1) . fromEnum
- enumFrom x = map toEnum [fromEnum x ..]
- enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]
- enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]
+ {-# INLINE succ #-}
+ succ = toEnum . (+ 1) . fromEnum
+
+ {-# INLINE pred #-}
+ pred = toEnum . (subtract 1) . fromEnum
+
+ {-# INLINE enumFrom #-}
+ enumFrom x = map toEnum [fromEnum x ..]
+
+ {-# INLINE enumFromThen #-}
+ enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]
+
+ {-# INLINE enumFromTo #-}
+ enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]
+
+ {-# INLINE enumFromThenTo #-}
enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]
-- Default methods for bounded enumerations
=====================================
libraries/base/GHC/List.hs
=====================================
@@ -277,10 +277,10 @@ to list-producing functions abstracted over cons and nil. Here we call them
FB functions because their names usually end with 'FB'. It's a good idea to
inline FB functions because:
-* They are higher-order functions and therefore benefits from inlining.
+* They are higher-order functions and therefore benefit from inlining.
* When the final consumer is a left fold, inlining the FB functions is the only
- way to make arity expansion to happen. See Note [Left fold via right fold].
+ way to make arity expansion happen. See Note [Left fold via right fold].
For this reason we mark all FB functions INLINE [0]. The [0] phase-specifier
ensures that calls to FB functions can be written back to the original form
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e8029816fda7602a8163c4d2703ff02982a3e48c...9cbab25f196232e5b30395b5c07d6f27229162ea
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e8029816fda7602a8163c4d2703ff02982a3e48c...9cbab25f196232e5b30395b5c07d6f27229162ea
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200511/87017dc7/attachment-0001.html>
More information about the ghc-commits
mailing list