[commit: ghc] wip/T11970: Formatting and comments (143cde8)

git at git.haskell.org git at git.haskell.org
Fri Jun 17 20:11:01 UTC 2016


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

On branch  : wip/T11970
Link       : http://ghc.haskell.org/trac/ghc/changeset/143cde8fc568da73171127f7bb67eda9c80383a5/ghc

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

commit 143cde8fc568da73171127f7bb67eda9c80383a5
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Tue May 24 11:35:10 2016 +0100

    Formatting and comments


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

143cde8fc568da73171127f7bb67eda9c80383a5
 compiler/rename/RnEnv.hs         | 20 +++++++++++++-------
 compiler/typecheck/TcRnDriver.hs |  5 ++---
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs
index 4965005..f34161b 100644
--- a/compiler/rename/RnEnv.hs
+++ b/compiler/rename/RnEnv.hs
@@ -571,7 +571,7 @@ lookupExportChild parent rdr_name
   overload_ok <- xoptM LangExt.DuplicateRecordFields
 
 
-  case (lookupGRE_RdrName rdr_name gre_env) of
+  case lookupGRE_RdrName rdr_name gre_env of
     [] -> return Nothing
     [x] -> return (Just ((:[]) <$> checkFld x))
     xs  -> Just <$> checkAmbig overload_ok rdr_name parent xs
@@ -590,15 +590,21 @@ lookupExportChild parent rdr_name
           case mfs of
             Nothing ->
               let fs = occNameFS (nameOccName name)
-              in (FieldLabel fs False name)
+              in FieldLabel fs False name
             Just fs -> FieldLabel fs True name
 
-        checkAmbig :: Bool -> RdrName -> Name -> [GlobalRdrElt] -> RnM (Either Name [FieldLabel])
+        checkAmbig :: Bool
+                   -> RdrName
+                   -> Name -- parent
+                   -> [GlobalRdrElt]
+                   -> RnM (Either Name [FieldLabel])
         checkAmbig overload_ok rdr_name parent gres
-          | (all isRecFldGRE gres && overload_ok)
-                = return $ Right ([fldParentToFieldLabel (gre_name gre) mfs
-                    | gre <- gres
-                    , let FldParent _ mfs = gre_par gre ])
+          | all isRecFldGRE
+                   gres && overload_ok
+                = return $
+                    Right [fldParentToFieldLabel (gre_name gre) mfs
+                            | gre <- gres
+                            , let FldParent _ mfs = gre_par gre ]
           | Just gre <- disambigChildren rdr_name parent gres
             = return ((:[]) <$> checkFld gre)
           | otherwise = do
diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs
index ff0f70b..70b24c5 100644
--- a/compiler/typecheck/TcRnDriver.hs
+++ b/compiler/typecheck/TcRnDriver.hs
@@ -2260,9 +2260,6 @@ loadUnqualIfaces hsc_env ictxt
 {-
 ******************************************************************************
 ** Typechecking module exports
-The renamer makes sure that only the correct pieces of a type or class can be
-bundled with the type or class in the export list.
-
 When it comes to pattern synonyms, in the renamer we have no way to check that
 whether a pattern synonym should be allowed to be bundled or not so we allow
 them to be bundled with any type or class. Here we then check that
@@ -2272,6 +2269,8 @@ them to be bundled with any type or class. Here we then check that
 2) Are the correct type, for example if P is a synonym
    then if we export Foo(P) then P should be an instance of Foo.
 
+We also check for normal parent, children relationships here as well.
+
 ******************************************************************************
 -}
 



More information about the ghc-commits mailing list