[commit: ghc] master: Add `PrelNames.thenAName` for `Applicative(*>)` (12dbc89)

git at git.haskell.org git at git.haskell.org
Tue Nov 24 06:01:34 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/12dbc89228d9a13c011e4f399db1bdc0fa4681f0/ghc

>---------------------------------------------------------------

commit 12dbc89228d9a13c011e4f399db1bdc0fa4681f0
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Mon Nov 23 22:25:38 2015 +0100

    Add `PrelNames.thenAName` for `Applicative(*>)`
    
    This is needed to allow subsequent patches to refer to `*>`.
    
    While at it, this commit also groups together the `Applicative` definitions
    to reduce confusion.
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D1513


>---------------------------------------------------------------

12dbc89228d9a13c011e4f399db1bdc0fa4681f0
 compiler/prelude/PrelNames.hs                      | 28 +++++++++++++---------
 .../should_fail/CustomTypeErrors02.stderr          |  2 +-
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index 1b1ffaa..cdf3df6 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -234,9 +234,8 @@ basicKnownKeyNames
         enumFromName, enumFromThenName,
         enumFromThenToName, enumFromToName,
 
-        -- Applicative/Alternative stuff
-        pureAName,
-        apAName,
+        -- Applicative stuff
+        pureAName, apAName, thenAName,
 
         -- Monad stuff
         thenIOName, bindIOName, returnIOName, failIOName, bindMName, thenMName,
@@ -927,9 +926,15 @@ monadFailClassName, failMName :: Name
 monadFailClassName = clsQual mONAD_FAIL (fsLit "MonadFail") monadFailClassKey
 failMName          = varQual mONAD_FAIL (fsLit "fail")      failMClassOpKey
 
--- Classes (Applicative, Foldable, Traversable)
-applicativeClassName, foldableClassName, traversableClassName :: Name
-applicativeClassName  = clsQual  gHC_BASE            (fsLit "Applicative") applicativeClassKey
+-- Class Applicative
+applicativeClassName, pureAName, apAName, thenAName :: Name
+applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey
+apAName              = varQual gHC_BASE (fsLit "<*>")         apAClassOpKey
+pureAName            = varQual gHC_BASE (fsLit "pure")        pureAClassOpKey
+thenAName            = varQual gHC_BASE (fsLit "*>")          thenAClassOpKey
+
+-- Classes (Foldable, Traversable)
+foldableClassName, traversableClassName :: Name
 foldableClassName     = clsQual  dATA_FOLDABLE       (fsLit "Foldable")    foldableClassKey
 traversableClassName  = clsQual  dATA_TRAVERSABLE    (fsLit "Traversable") traversableClassKey
 
@@ -937,17 +942,18 @@ traversableClassName  = clsQual  dATA_TRAVERSABLE    (fsLit "Traversable") trave
 
 -- AMP additions
 
-joinMName,  apAName, pureAName, alternativeClassName :: Name
+joinMName, alternativeClassName :: Name
 joinMName            = varQual gHC_BASE (fsLit "join")        joinMIdKey
-apAName              = varQual gHC_BASE (fsLit "<*>")         apAClassOpKey
-pureAName            = varQual gHC_BASE (fsLit "pure")        pureAClassOpKey
 alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
 
-joinMIdKey, apAClassOpKey, pureAClassOpKey, alternativeClassKey :: Unique
+--
+joinMIdKey, apAClassOpKey, pureAClassOpKey, thenAClassOpKey,
+    alternativeClassKey :: Unique
 joinMIdKey          = mkPreludeMiscIdUnique 750
 apAClassOpKey       = mkPreludeMiscIdUnique 751 -- <*>
 pureAClassOpKey     = mkPreludeMiscIdUnique 752
-alternativeClassKey = mkPreludeMiscIdUnique 753
+thenAClassOpKey     = mkPreludeMiscIdUnique 753
+alternativeClassKey = mkPreludeMiscIdUnique 754
 
 
 -- Functions for GHC extensions
diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
index 9ca22ee..2fd9036 100644
--- a/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
+++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
@@ -1,6 +1,6 @@
 
 CustomTypeErrors02.hs:17:1: error:
-    The type 'a_aES -> a_aES' cannot be represented as an integer.
+    The type 'a_aER -> a_aER' cannot be represented as an integer.
     When checking that ‘err’ has the inferred type
       err :: (TypeError ...)
 



More information about the ghc-commits mailing list