RecordDotSyntax field updates
Moduleghc-9.10.3GHC2021
Language.Haskell.Syntax.Expr
Abstract Haskell syntax for expressions.
- 49 types
- 9 values
- Packageghc-9.10.3
- Exports59
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceExpr.hs
Constructors
FieldLabelStrings [XRec p (DotFieldOcc p)]
Instances7Data, Outputable, OutputableBndr, Anno, …
Data (FieldLabelStrings GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (FieldLabelStrings GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (FieldLabelStrings GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => Outputable (FieldLabelStrings p)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (Located (FieldLabelStrings p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (FieldLabelStrings p)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (FieldLabelStrings (GhcPass p)) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Haskell Record Update Fields.
Constructors
RegularRecUpdFields :: XLHsRecUpdLabels p -> [LHsRecUpdField p p] -> LHsRecUpdFields pA regular (non-overloaded) record update.
xRecUpdFields :: XLHsRecUpdLabels precUpdFields :: [LHsRecUpdField p p]
OverloadedRecUpdFields :: XLHsOLRecUpdLabels p -> [LHsRecUpdProj p] -> LHsRecUpdFields pAn overloaded record update.
Instances3Data
Data (LHsRecUpdFields GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (LHsRecUpdFields GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (LHsRecUpdFields GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan
Expressions proper
52 declarationsLocated Haskell Expression
Syntax Expression
SyntaxExpr is represents the function used in interpreting rebindable
syntax. In the parser, we have no information to supply; in the renamer,
we have the name of the function (but see
Note [Monad fail : Rebindable syntax, overloaded strings] for a wrinkle)
and in the type-checker we have a more elaborate structure SyntaxExprTc.
In some contexts, rebindable syntax is not implemented, and so we have constructors to represent that possibility in both the renamer and typechecker instantiations.
E.g. (>>=) is filled in before the renamer by the appropriate Name for
(>>=), and then instantiated by the type checker with its type args
etc
Instances1SyntaxExpr
type SyntaxExpr (GhcPass p) = SyntaxExprGhc pDefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
A Haskell expression.
Constructors
HsVar (XVar p) (LIdP p)Variable See Note [Located RdrNames]
HsUnboundVar (XUnboundVar p) RdrNameUnbound variable; also used for "holes" (_ or _x). Turned from HsVar to HsUnboundVar by the renamer, when it finds an out-of-scope variable or hole. The (XUnboundVar p) field becomes an HoleExprRef after typechecking; this is where the erroring expression will be written after solving. See Note [Holes] in GHC.Tc.Types.Constraint.
HsRecSel (XRecSel p) (FieldOcc p)Variable pointing to record selector See Note [Non-overloaded record field selectors] and Note [Record selectors in the AST]
HsOverLabel (XOverLabel p) SourceText FastStringOverloaded label (Note [Overloaded labels] in GHC.OverloadedLabels) Note [Pragma source text] in GHC.Types.SourceText
HsIPVar (XIPVar p) HsIPNameImplicit parameter (not in use after typechecking)
HsOverLit (XOverLitE p) (HsOverLit p)Overloaded literals
HsLit (XLitE p) (HsLit p)Simple (non-overloaded) literals
HsLam (XLam p) HsLamVariant (MatchGroup p (LHsExpr p))Lambda, Lambda-case, and Lambda-cases
HsApp (XApp p) (LHsExpr p) (LHsExpr p)Application
HsAppType (XAppTypeE p) (LHsExpr p) (LHsWcType (NoGhcTc p))Visible type application
Explicit type argument; e.g f @Int x y NB: Has wildcards, but no implicit quantification
AnnKeywordId :
GHC.Parser.Annotation.AnnAt,
OpApp (XOpApp p) (LHsExpr p) (LHsExpr p) (LHsExpr p)Operator applications: NB Bracketed ops such as (+) come out as Vars.
NegApp (XNegApp p) (LHsExpr p) (SyntaxExpr p)Negation operator. Contains the negated expression and the name of
negateHsPar (XPar p) (LHsExpr p)AnnKeywordId : AnnOpen
'(', AnnClose')'
SectionL (XSectionL p) (LHsExpr p) (LHsExpr p)SectionR (XSectionR p) (LHsExpr p) (LHsExpr p)ExplicitTuple (XExplicitTuple p) [HsTupArg p] BoxityUsed for explicit tuples and sections thereof
ExplicitSum (XExplicitSum p) ConTag SumWidth (LHsExpr p)Used for unboxed sum types
AnnKeywordId : AnnOpen
'(#', AnnVbar, AnnClose'#)',
There will be multiple AnnVbar, (1 - alternative) before the expression, (arity - alternative) after it
HsCase (XCase p) (LHsExpr p) (MatchGroup p (LHsExpr p))AnnKeywordId : AnnCase, AnnOf,AnnOpen
'{', AnnClose'}'
HsIf (XIf p) (LHsExpr p) (LHsExpr p) (LHsExpr p)HsMultiIf (XMultiIf p) [LGRHS p (LHsExpr p)]Multi-way if
HsLet (XLet p) (HsLocalBinds p) (LHsExpr p)let(rec)
AnnKeywordId : AnnLet, AnnOpen
'{', AnnClose'}',AnnIn
HsDo (XDo p) HsDoFlavour (XRec p [ExprLStmt p])ExplicitList (XExplicitList p) [LHsExpr p]Syntactic list: [a,b,c,...]
AnnKeywordId : AnnOpen
'[', AnnClose']'
RecordConRecord construction
AnnKeywordId : AnnOpen
'{', AnnDotdot,AnnClose'}'
rcon_ext :: XRecordCon prcon_con :: XRec p (ConLikeP p)rcon_flds :: HsRecordBinds p
RecordUpdRecord update
rupd_ext :: XRecordUpd prupd_expr :: LHsExpr prupd_flds :: LHsRecUpdFields p
HsGetFieldRecord field selection e.g
z.x.HsProjectionRecord field selector. e.g.
(.x)or(.x.y)This case only arises when the OverloadedRecordDot langauge extensions is enabled. See Note [Record selectors in the AST].
proj_ext :: XProjection pproj_flds :: NonEmpty (XRec p (DotFieldOcc p))
ExprWithTySig (XExprWithTySig p) (LHsExpr p) (LHsSigWcType (NoGhcTc p))Expression with an explicit type signature.
e :: typeArithSeq (XArithSeq p) (Maybe (SyntaxExpr p)) (ArithSeqInfo p)Arithmetic sequence
AnnKeywordId : AnnOpen
'[', AnnComma,AnnDotdot, AnnClose']'
HsTypedBracket (XTypedBracket p) (LHsExpr p)HsUntypedBracket (XUntypedBracket p) (HsQuote p)HsTypedSplice (XTypedSplice p) (LHsExpr p)HsUntypedSplice (XUntypedSplice p) (HsUntypedSplice p)HsProc (XProc p) (LPat p) (LHsCmdTop p)procnotation for ArrowsHsStatic (XStatic p) (LHsExpr p)HsPragE (XPragE p) (HsPragE p) (LHsExpr p)HsEmbTy (XEmbTy p) (LHsWcType (NoGhcTc p))XExpr !(XXExpr p)
Instances32Outputable, HasType, ToHie, DisambECP, DisambInfixOp, Data, …
Data (HsExpr GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsExpr GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsExpr GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsExpr (GhcPass p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanHiePass p => HasType (LocatedA (HsExpr (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.AstThis instance tries to construct HieAST nodes which include the type of the expression. It is not yet possible to do this efficiently for all expression forms, so we skip filling in the type for those inputs.
See Note [Computing the type of every node in the tree]
HiePass p => ToHie (LocatedA (HsExpr (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.AstDisambECP (HsExpr GhcPs)Defined in ghc-9.10.3 · GHC.Parser.PostProcessDisambInfixOp (HsExpr GhcPs)Defined in ghc-9.10.3 · GHC.Parser.PostProcessData (GRHS GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (HsExpr (GhcPass p)) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsExpr (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Body (HsExpr GhcPs) = HsExprDefined in ghc-9.10.3 · GHC.Parser.PostProcesstype FunArg (HsExpr GhcPs) = HsExpr GhcPsDefined in ghc-9.10.3 · GHC.Parser.PostProcesstype InfixOp (HsExpr GhcPs) = HsExpr GhcPsDefined in ghc-9.10.3 · GHC.Parser.PostProcess
Constructors
Instances5Data, Outputable, Anno
Data (DotFieldOcc GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (DotFieldOcc GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (DotFieldOcc GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanUnXRec p => Outputable (DotFieldOcc p)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (DotFieldOcc (GhcPass p)) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
A pragma, written as {-# ... #-}, that may appear within an expression.
Instances4Data, Outputable
Located Haskell Tuple Argument
HsTupArg is used for tuple sections
(,a,) is represented by
ExplicitTuple [Missing ty1, Present a, Missing ty3]
Which in turn stands for (x:ty1 y:ty2. (x,a,y))
Haskell Tuple Argument
Instances4Data, ToHie
Which kind of lambda case are we dealing with?
Instances3Eq, Data, Outputable
Eq HsLamVariantDefined in ghc-9.10.3 · Language.Haskell.Syntax.ExprData HsLamVariantDefined in ghc-9.10.3 · Language.Haskell.Syntax.ExprOutputable HsLamVariantDefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Located Haskell Command (for arrow syntax)
Haskell Command (e.g. a "statement" in an Arrow proc block)
Constructors
HsCmdArrApp (XCmdArrApp id) (LHsExpr id) (LHsExpr id) HsArrAppType BoolHsCmdArrForm (XCmdArrForm id) (LHsExpr id) LexicalFixity (Maybe Fixity) [LHsCmdTop id]AnnKeywordId : AnnOpenB
'(|', AnnCloseB'|)'
HsCmdApp (XCmdApp id) (LHsCmd id) (LHsExpr id)HsCmdLam (XCmdLamCase id) HsLamVariant (MatchGroup id (LHsCmd id))Lambda-case
AnnKeywordId : AnnLam, AnnCase,AnnOpen
'{', AnnClose'}'AnnKeywordId : AnnLam, AnnCases,AnnOpen
'{', AnnClose'}'
HsCmdPar (XCmdPar id) (LHsCmd id)AnnKeywordId : AnnOpen
'(', AnnClose')'
HsCmdCase (XCmdCase id) (LHsExpr id) (MatchGroup id (LHsCmd id))AnnKeywordId : AnnCase, AnnOf,AnnOpen
'{', AnnClose'}'
HsCmdIf (XCmdIf id) (SyntaxExpr id) (LHsExpr id) (LHsCmd id) (LHsCmd id)HsCmdLet (XCmdLet id) (HsLocalBinds id) (LHsCmd id)AnnKeywordId : AnnLet, AnnOpen
'{', AnnClose'}',AnnIn
HsCmdDo (XCmdDo id) (XRec id [CmdLStmt id])XCmd !(XXCmd id)
Instances32Outputable, ToHie, DisambECP, Data, Anno, Body, …
Data (HsCmd GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsCmd GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsCmd GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsCmd (GhcPass p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanHiePass p => ToHie (LocatedA (HsCmd (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.AstDisambECP (HsCmd GhcPs)Defined in ghc-9.10.3 · GHC.Parser.PostProcessData (GRHS GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (HsCmd (GhcPass p)) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Body (HsCmd GhcPs) = HsCmdDefined in ghc-9.10.3 · GHC.Parser.PostProcesstype FunArg (HsCmd GhcPs) = HsExpr GhcPsDefined in ghc-9.10.3 · GHC.Parser.PostProcesstype InfixOp (HsCmd GhcPs) = HsExpr GhcPsDefined in ghc-9.10.3 · GHC.Parser.PostProcess
Haskell arrow application type.
Constructors
HsHigherOrderAppFirst order arrow application
-<HsFirstOrderAppHigher order arrow application
-<<
Instances1Data
Data HsArrAppTypeDefined in ghc-9.10.3 · Language.Haskell.Syntax.Expr
Top-level command, introducing a new arrow. This may occur inside a proc (where the stack is empty) or as an argument of a command-forming operator.
Located Haskell Top-level Command
Instances6Data, Outputable, ToHie, Anno
Data (HsCmdTop GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsCmdTop GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsCmdTop GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsCmdTop (GhcPass p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanHiePass p => ToHie (LocatedAn NoEpAnns (HsCmdTop (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.Asttype Anno (HsCmdTop (GhcPass p)) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Haskell Record Bindings
Constructors
MGXMatchGroup !(XXMatchGroup p body)
Instances7Data, ToHie, …
Data (MatchGroup GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(HiePass p, AnnoBody p body, ToHie (LocatedA (body (GhcPass p)))) => ToHie (MatchGroup (GhcPass p) (LocatedA (body (GhcPass p))))Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Located Match
May have AnnKeywordId : AnnSemi when in a list
Instances14ToHie, Data, Outputable, Anno, …
(HiePass p, Data (body (GhcPass p)), AnnoBody p body, ToHie (LocatedA (body (GhcPass p)))) => ToHie (LocatedA (Match (GhcPass p) (LocatedA (body (GhcPass p)))))Defined in ghc-9.10.3 · GHC.Iface.Ext.AstData (Match GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(OutputableBndrId pr, Outputable body) => Outputable (Match (GhcPass pr) body)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (Match GhcPs (LocatedA (PatBuilder GhcPs))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Parser.Typestype Anno (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match GhcPs (LocatedA (PatBuilder GhcPs)))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Parser.Typestype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Guarded Right-Hand Sides
GRHSs are used both for pattern bindings and for Matches
Constructors
GRHSsgrhssExt :: XCGRHSs p bodygrhssGRHSs :: [LGRHS p body]Guarded RHSs
grhssLocalBinds :: HsLocalBinds pThe where clause
XGRHSs !(XXGRHSs p body)
Instances7Data, ToHie, …
Data (GRHSs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(ToHie (LocatedA (body (GhcPass p))), HiePass p, AnnoBody p body) => ToHie (GRHSs (GhcPass p) (LocatedA (body (GhcPass p))))Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Located Guarded Right-Hand Side
Guarded Right Hand Side.
Constructors
GRHS (XCGRHS p body) [GuardLStmt p] bodyXGRHS !(XXGRHS p body)
Instances10Data, ToHie, Anno, …
Data (GRHS GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(ToHie (LocatedA (body (GhcPass p))), HiePass p, AnnoBody p body) => ToHie (LocatedAn NoEpAnns (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))))Defined in ghc-9.10.3 · GHC.Iface.Ext.Asttype Anno (GRHS GhcPs (LocatedA (PatBuilder GhcPs))) = EpAnnCODefined in ghc-9.10.3 · GHC.Parser.Typestype Anno (GRHS (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = EpAnnCODefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Located do block Statement
Located Statement with separate Left and Right id's
do block Statement
Command Located Statement
Command Statement
Expression Located Statement
Expression Statement
Guard Located Statement
Guard Statement
Ghci Located Statement
Ghci Statement
Exact print annotations when in qualifier lists or guards - AnnKeywordId : AnnVbar, AnnComma,AnnThen, AnnBy,AnnBy, AnnGroup,AnnUsing
Constructors
LastStmt (XLastStmt idL idR body) body (Maybe Bool) (SyntaxExpr idR)BindStmt (XBindStmt idL idR body) (LPat idL) bodyApplicativeStmt (XApplicativeStmt idL idR body) [(SyntaxExpr idR, ApplicativeArg idL)] (Maybe (SyntaxExpr idR))ApplicativeStmt represents an applicative expression built with
<$>and<*>. It is generated by the renamer, and is desugared into the appropriate applicative expression by the desugarer, but it is intended to be invisible in error messages.For full details, see Note [ApplicativeDo] in GHC.Rename.Expr
BodyStmt (XBodyStmt idL idR body) body (SyntaxExpr idR) (SyntaxExpr idR)LetStmt (XLetStmt idL idR body) (HsLocalBindsLR idL idR)AnnKeywordId : AnnLet AnnOpen
'{',AnnClose'}',
ParStmt (XParStmt idL idR body) [ParStmtBlock idL idR] (HsExpr idR) (SyntaxExpr idR)TransStmtRecStmtrecS_ext :: XRecStmt idL idR bodyrecS_stmts :: XRec idR [LStmtLR idL idR body]recS_later_ids :: [IdP idR]recS_rec_ids :: [IdP idR]recS_bind_fn :: SyntaxExpr idRrecS_ret_fn :: SyntaxExpr idRrecS_mfix_fn :: SyntaxExpr idR
XStmtLR !(XXStmtLR idL idR body)
Instances20ToHie, Data, Outputable, Anno, …
(ToHie (LocatedA (body (GhcPass p))), AnnoBody p body, HiePass p) => ToHie (RScoped (LocatedA (Stmt (GhcPass p) (LocatedA (body (GhcPass p))))))Defined in ghc-9.10.3 · GHC.Iface.Ext.AstData (StmtLR GhcPs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(OutputableBndrId pl, OutputableBndrId pr, Anno (StmtLR (GhcPass pl) (GhcPass pr) body) ~ SrcSpanAnnA, Outputable body) => Outputable (StmtLR (GhcPass pl) (GhcPass pr) body)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (StmtLR GhcPs GhcPs (LocatedA (PatBuilder GhcPs))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Parser.Typestype Anno (StmtLR GhcRn GhcRn (LocatedA (body GhcRn))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr)))) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR GhcPs GhcPs (LocatedA (PatBuilder GhcPs)))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Parser.Typestype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsExpr (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr))))] = SrcSpanAnnLDefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Parenthesised Statement Block
Constructors
ParStmtBlock (XParStmtBlock idL idR) [ExprLStmt idL] [IdP idR] (SyntaxExpr idR)XParStmtBlock !(XXParStmtBlock idL idR)
Instances5Data, Outputable
Data (ParStmtBlock GhcPs GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcPs GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcRn GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcTc GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphan(Outputable (StmtLR (GhcPass idL) (GhcPass idL) (LHsExpr (GhcPass idL))), Outputable (XXParStmtBlock (GhcPass idL) (GhcPass idR))) => Outputable (ParStmtBlock (GhcPass idL) (GhcPass idR))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphan
The fail operator
This is used for `.. <-` "bind statements" in do notation, including non-monadic "binds" in applicative.
The fail operator is 'Just expr' if it potentially fail monadically. if the pattern match cannot fail, or shouldn't fail monadically (regular incomplete pattern exception), it is Nothing.
See Note [Monad fail : Rebindable syntax, overloaded strings] for the type of expression in the Just case, and why it is so.
See Note [Failing pattern matches in Stmts] for which contexts for
'BindStmt's should use the monadic fail and which shouldn't.
Applicative Argument
Constructors
ApplicativeArgOnexarg_app_arg_one :: XApplicativeArgOne idLThe fail operator, after renaming
The fail operator is needed if this is a BindStmt where the pattern can fail. E.g.: (Just a) <- stmt The fail operator will be invoked if the pattern match fails. It is also used for guards in MonadComprehensions. The fail operator is Nothing if the pattern match can't fail
app_arg_pattern :: LPat idLarg_expr :: LHsExpr idLis_body_stmt :: Bool
ApplicativeArgManyxarg_app_arg_many :: XApplicativeArgMany idLapp_stmts :: [ExprLStmt idL]final_expr :: HsExpr idLbv_pattern :: LPat idLstmt_context :: HsDoFlavourcontext of the do expression, used in pprArg
XApplicativeArg !(XXApplicativeArg idL)
Instances5Data, Outputable, ToHie
Data (ApplicativeArg GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ApplicativeArg GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ApplicativeArg GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId idL => Outputable (ApplicativeArg (GhcPass idL))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanHiePass p => ToHie (RScoped (ApplicativeArg (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Haskell Splice
Constructors
HsUntypedSpliceExpr (XUntypedSpliceExpr id) (LHsExpr id)HsQuasiQuote (XQuasiQuote id) (IdP id) (XRec id FastString)XUntypedSplice !(XXUntypedSplice id)
Instances5Data, ToHie, Anno
Data (HsUntypedSplice GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsUntypedSplice GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsUntypedSplice GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanHiePass p => ToHie (LocatedA (HsUntypedSplice (GhcPass p)))Defined in ghc-9.10.3 · GHC.Iface.Ext.Asttype Anno (HsUntypedSplice (GhcPass p)) = SrcSpanAnnADefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Haskell (Untyped) Quote = Expr + Pat + Type + Var
Instances5Data, Outputable, ToHie
Data (HsQuote GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsQuote GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (HsQuote GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsQuote (GhcPass p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanToHie (HsQuote GhcRn)Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Arithmetic Sequence Information
Instances5Data, Outputable, ToHie
Data (ArithSeqInfo GhcPs)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ArithSeqInfo GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanData (ArithSeqInfo GhcTc)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (ArithSeqInfo (GhcPass p))Defined in ghc-9.10.3 · GHC.Hs.Expr · orphanToHie (LHsExpr a) => ToHie (ArithSeqInfo a)Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Haskell Match Context
Context of a pattern match. This is more subtle than it would seem. See Note [FunBind vs PatBind].
Constructors
FunRhsA pattern matching on an argument of a function binding
mc_fun :: fnfunction binder of
fSee Note [mc_fun field of FunRhs] See #20415 for a long discussion about this fieldmc_fixity :: LexicalFixityfixing of
fmc_strictness :: SrcStrictnesswas
fbanged? See Note [FunBind vs PatBind]
CaseAltPatterns and guards in a case alternative
LamAlt HsLamVariantPatterns and guards in
@,caseandcases@IfAltGuards of a multi-way if alternative
ArrowMatchCtxt HsArrowMatchContextA pattern match inside arrow notation
PatBindRhsA pattern binding eg [y] <- e = e
PatBindGuardsGuards of pattern bindings, e.g., (Just b) | Just _ <- x = e | otherwise = e'
RecUpdRecord update [used only in GHC.HsToCore.Expr to tell matchWrapper what sort of runtime error message to generate]
StmtCtxt (HsStmtContext fn)Pattern of a do-stmt, list comprehension, pattern guard, etc
ThPatSpliceA Template Haskell pattern splice
ThPatQuoteA Template Haskell pattern quotation [p| (a,b) |]
PatSynA pattern synonym declaration
LazyPatCtxAn irrefutable pattern
Instances2Data, Outputable
Data fn => Data (HsMatchContext fn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputable fn => Outputable (HsMatchContext fn)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Haskell Statement Context.
Constructors
HsDoStmt HsDoFlavourContext for HsDo (do-notation and comprehensions)
PatGuard (HsMatchContext fn)Pattern guard for specified thing
ParStmtCtxt (HsStmtContext fn)A branch of a parallel stmt
TransStmtCtxt (HsStmtContext fn)A branch of a transform stmt
ArrowExprdo-notation in an arrow-command context
Instances2Data, Outputable
Data fn => Data (HsStmtContext fn)Defined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputable fn => Outputable (HsStmtContext fn)Defined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Haskell arrow match context.
Constructors
ProcExprA proc expression
ArrowCaseAltA case alternative inside arrow notation
ArrowLamAlt HsLamVariantA , case or cases alternative inside arrow notation
Instances2Data, Outputable
Data HsArrowMatchContextDefined in ghc-9.10.3 · GHC.Hs.Instances · orphanOutputable HsArrowMatchContextDefined in ghc-9.10.3 · GHC.Hs.Expr · orphan
Constructors
DoExpr (Maybe ModuleName)- ModuleName.
do { ... }
MDoExpr (Maybe ModuleName)- ModuleName.
mdo { ... } ie recursive do-expression
GhciStmtCtxtA command-line Stmt in GHCi pat <- rhs
ListCompMonadComp
Instances2Eq, Data
Eq HsDoFlavourDefined in ghc-9.10.3 · Language.Haskell.Syntax.ExprData HsDoFlavourDefined in ghc-9.10.3 · Language.Haskell.Syntax.Expr
Is this a monadic context?