[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:20:00 UTC 2020



Vilem-Benjamin Liepelt pushed to branch wip/buggymcbugfix/15185-enum-int at Glasgow Haskell Compiler / GHC


Commits:
f0a86479 by buggymcbugfix at 2020-05-12T01:18:08+03:00
Fix spelling mistakes and typos

- - - - -
d7c52e1a by buggymcbugfix at 2020-05-12T01:18:18+03:00
Add inline pragmas to Enum methods

Fixes t15185

- - - - -


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/951b8eda5a1326415a5ef5db23f00e16f70fccab...d7c52e1a848a7a1adf92132aae566db21d7b4232

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/951b8eda5a1326415a5ef5db23f00e16f70fccab...d7c52e1a848a7a1adf92132aae566db21d7b4232
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/b59c6f6f/attachment-0001.html>


More information about the ghc-commits mailing list