[commit: ghc] wip/orf-2017: Comments only (bdd3158)

git at git.haskell.org git at git.haskell.org
Wed Feb 8 21:24:14 UTC 2017


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

On branch  : wip/orf-2017
Link       : http://ghc.haskell.org/trac/ghc/changeset/bdd315839d1b906718d7bc7255fab3cbf0f702e2/ghc

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

commit bdd315839d1b906718d7bc7255fab3cbf0f702e2
Author: Adam Gundry <adam at well-typed.com>
Date:   Wed Feb 8 21:22:10 2017 +0000

    Comments only


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

bdd315839d1b906718d7bc7255fab3cbf0f702e2
 compiler/basicTypes/RdrName.hs | 11 ++++++-----
 compiler/hsSyn/HsExpr.hs       |  2 ++
 compiler/typecheck/TcSMonad.hs |  6 ++++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs
index 69dd020..d70724b 100644
--- a/compiler/basicTypes/RdrName.hs
+++ b/compiler/basicTypes/RdrName.hs
@@ -800,15 +800,16 @@ lookupGRE_Name env name
   = lookupGRE_Name_OccName env name (nameOccName name)
 
 lookupGRE_FieldLabel :: GlobalRdrEnv -> FieldLabel -> Maybe GlobalRdrElt
--- ^ Look for a particular record field selector in the environment,
--- where the selector name and field label may be different: the
--- GlobalRdrEnv is keyed on the label.
+-- ^ Look for a particular record field selector in the environment, where the
+-- selector name and field label may be different: the GlobalRdrEnv is keyed on
+-- the label.  See Note [Parents for record fields] for why this happens.
 lookupGRE_FieldLabel env fl
   = lookupGRE_Name_OccName env (flSelector fl) (mkVarOccFS (flLabel fl))
 
 lookupGRE_Name_OccName :: GlobalRdrEnv -> Name -> OccName -> Maybe GlobalRdrElt
--- ^ Look for precisely this 'Name' in the environment, but with an
--- 'OccName' that might differ from that of the 'Name'.
+-- ^ Look for precisely this 'Name' in the environment, but with an 'OccName'
+-- that might differ from that of the 'Name'.  See 'lookupGRE_FieldLabel' and
+-- Note [Parents for record fields].
 lookupGRE_Name_OccName env name occ
   = case [ gre | gre <- lookupGlobalRdrEnv env occ
                , gre_name gre == name ] of
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 23a960e..4a37998 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -295,6 +295,8 @@ data HsExpr id
 
   | HsOverLabel (Maybe id) FastString
      -- ^ Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels)
+     --   @Just id@ means @RebindableSyntax@ is in use, and gives the id of the
+     --   in-scope 'fromLabel'.
      --   NB: Not in use after typechecking
 
   | HsIPVar   HsIPName       -- ^ Implicit parameter (not in use after typechecking)
diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs
index 5142baf..b76b2d3 100644
--- a/compiler/typecheck/TcSMonad.hs
+++ b/compiler/typecheck/TcSMonad.hs
@@ -2816,8 +2816,10 @@ instFlexiHelper subst tv
        ; return (extendTvSubst subst tv ty') }
 
 tcInstType :: ([TyVar] -> TcM (TCvSubst, [TcTyVar]))
-           -> Id
-           -> TcS ([(Name, TcTyVar)], TcThetaType, TcType)
+                   -- ^ How to instantiate the type variables
+           -> Id   -- ^ Type to instantiate
+           -> TcS ([(Name, TcTyVar)], TcThetaType, TcType) -- ^ Result
+                -- (type vars, preds (incl equalities), rho)
 tcInstType inst_tyvars id = wrapTcS (TcM.tcInstType inst_tyvars id)
 
 



More information about the ghc-commits mailing list