summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-02-21 21:16:24 +0000
committerAlan Zimmerman <alan.zimm@gmail.com>2021-02-28 12:46:19 +0000
commit09947ecee1bdc450ce561543f68bee6765122fb5 (patch)
tree960d25ad941ce1ef14ca3ba1581a041708685f9b /compiler/Language/Haskell/Syntax
parent035d983dfa217bf8784b86e78d6024a3ca1a3f4f (diff)
downloadhaskell-wip/az/maybecontext.tar.gz
Wrap LHsContext in Maybe in the GHC ASTwip/az/maybecontext
If the context is missing it is captured as Nothing, rather than putting a noLoc in the ParsedSource. Updates haddock submodule
Diffstat (limited to 'compiler/Language/Haskell/Syntax')
-rw-r--r--compiler/Language/Haskell/Syntax/Decls.hs4
-rw-r--r--compiler/Language/Haskell/Syntax/Type.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/Language/Haskell/Syntax/Decls.hs b/compiler/Language/Haskell/Syntax/Decls.hs
index 453b963028..0df44e8016 100644
--- a/compiler/Language/Haskell/Syntax/Decls.hs
+++ b/compiler/Language/Haskell/Syntax/Decls.hs
@@ -436,7 +436,7 @@ data TyClDecl pass
, tcdDataDefn :: HsDataDefn pass }
| ClassDecl { tcdCExt :: XClassDecl pass, -- ^ Post renamer, FVs
- tcdCtxt :: LHsContext pass, -- ^ Context...
+ tcdCtxt :: Maybe (LHsContext pass), -- ^ Context...
tcdLName :: LIdP pass, -- ^ Name of the class
tcdTyVars :: LHsQTyVars pass, -- ^ Class type variables
tcdFixity :: LexicalFixity, -- ^ Fixity used in the declaration
@@ -891,7 +891,7 @@ data HsDataDefn pass -- The payload of a data type defn
-- @
HsDataDefn { dd_ext :: XCHsDataDefn pass,
dd_ND :: NewOrData,
- dd_ctxt :: LHsContext pass, -- ^ Context
+ dd_ctxt :: Maybe (LHsContext pass), -- ^ Context
dd_cType :: Maybe (XRec pass CType),
dd_kindSig:: Maybe (LHsKind pass),
-- ^ Optional kind signature.
diff --git a/compiler/Language/Haskell/Syntax/Type.hs b/compiler/Language/Haskell/Syntax/Type.hs
index 0427fd65f3..f0114403d8 100644
--- a/compiler/Language/Haskell/Syntax/Type.hs
+++ b/compiler/Language/Haskell/Syntax/Type.hs
@@ -736,7 +736,7 @@ data HsType pass
| HsQualTy -- See Note [HsType binders]
{ hst_xqual :: XQualTy pass
- , hst_ctxt :: LHsContext pass -- Context C => blah
+ , hst_ctxt :: Maybe (LHsContext pass) -- Context C => blah
, hst_body :: LHsType pass }
| HsTyVar (XTyVar pass)