[commit: ghc] master: Comments only (25f2d68)

git at git.haskell.org git at git.haskell.org
Tue Apr 14 12:13:45 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/25f2d68849288a57ae4c6ce492f9e0bdd6df83bb/ghc

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

commit 25f2d68849288a57ae4c6ce492f9e0bdd6df83bb
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Apr 14 09:21:00 2015 +0100

    Comments only


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

25f2d68849288a57ae4c6ce492f9e0bdd6df83bb
 compiler/hsSyn/HsTypes.hs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs
index 8c7a524..ebd3bd4 100644
--- a/compiler/hsSyn/HsTypes.hs
+++ b/compiler/hsSyn/HsTypes.hs
@@ -417,7 +417,7 @@ After renaming
 Qualified currently behaves exactly as Implicit,
 but it is deprecated to use it for implicit quantification.
 In this case, GHC 7.10 gives a warning; see
-Note [Context quantification] and Trac #4426.
+Note [Context quantification] in RnTypes, and Trac #4426.
 In GHC 7.12, Qualified will no longer bind variables
 and this will become an error.
 
@@ -506,7 +506,12 @@ data HsTupleSort = HsUnboxedTuple
                  | HsBoxedOrConstraintTuple
                  deriving (Data, Typeable)
 
-data HsExplicitFlag = Qualified | Implicit | Explicit deriving (Data, Typeable)
+data HsExplicitFlag
+  = Explicit     -- An explicit forall, eg  f :: forall a. a-> a
+  | Implicit     -- No explicit forall, eg  f :: a -> a, or f :: Eq a => a -> a
+  | Qualified    -- A *nested* occurrences of (ctxt => ty), with no explicit forall
+                 -- e.g.  f :: (Eq a => a -> a) -> Int
+ deriving (Data, Typeable)
 
 type LConDeclField name = Located (ConDeclField name)
       -- ^ May have 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnComma' when
@@ -571,6 +576,8 @@ Qualified `plus` Qualified = Qualified
 Explicit  `plus` _         = Explicit
 _         `plus` Explicit  = Explicit
 _         `plus` _         = Implicit
+  -- NB: Implicit `plus` Qualified = Implicit
+  --     so that  f :: Eq a => a -> a  ends up Implicit
 
 hsExplicitTvs :: LHsType Name -> [Name]
 -- The explicitly-given forall'd type variables of a HsType



More information about the ghc-commits mailing list