RecordDotSyntax field updates
Moduleghc-lib-parser-9.14.1.20251220GHC2021
Language.Haskell.Syntax.Expr
Abstract Haskell syntax for expressions.
- 49 types
- 8 values
- Packageghc-lib-parser-9.14.1.20251220
- Exports58
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceExpr.hs
Constructors
FieldLabelStrings (NonEmpty (XRec p (DotFieldOcc p)))
Instances7Data, Outputable, OutputableBndr, Anno, …
Data (FieldLabelStrings GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (FieldLabelStrings GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (FieldLabelStrings GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => Outputable (FieldLabelStrings p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (Located (FieldLabelStrings p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan(UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (FieldLabelStrings p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (FieldLabelStrings (GhcPass p)) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (LHsRecUpdFields GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (LHsRecUpdFields GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan
Expressions proper
51 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-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
A Haskell expression.
Constructors
HsVar (XVar p) (LIdOccP p)Variable See Note [Located RdrNames]
HsOverLabel (XOverLabel p) FastStringOverloaded label (Note [Overloaded labels] in GHC.OverloadedLabels)
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
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)Parenthesised expr; see Note [Parens in HsSyn]
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
HsCase (XCase p) (LHsExpr p) (MatchGroup p (LHsExpr p))HsIf (XIf p) (LHsExpr p) (LHsExpr p) (LHsExpr p)HsMultiIf (XMultiIf p) (NonEmpty (LGRHS p (LHsExpr p)))Multi-way if
HsLet (XLet p) (HsLocalBinds p) (LHsExpr p)let(rec)
HsDo (XDo p) HsDoFlavour (XRec p [ExprLStmt p])ExplicitList (XExplicitList p) [LHsExpr p]Syntactic list: [a,b,c,...]
RecordConRecord construction
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 (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
HsTypedBracket (XTypedBracket p) (LHsExpr p)HsUntypedBracket (XUntypedBracket p) (HsQuote p)HsTypedSplice (XTypedSplice p) (HsTypedSplice 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))HsHole (XHole p)Holes in expressions, i.e.
_. See Note [Holes in expressions] in GHC.Tc.Types.Constraint.HsForAll (XForAll p) (HsForAllTelescope p) (LHsExpr p)Forall-types
forall tvs. tandforall tvs -> t. Used withRequiredTypeArguments, e.g.fn (forall a. Proxy a). See Note [Types in terms]HsQual (XQual p) (XRec p [LHsExpr p]) (LHsExpr p)HsFunArr (XFunArr p) (HsMultAnnOf (LHsExpr p) p) (LHsExpr p) (LHsExpr p)Function types
a -> b. Used withRequiredTypeArguments, e.g.fn (Int -> Bool). See Note [Types in terms]XExpr !(XXExpr p)
Instances35Outputable, CollectBinders, DisambECP, DisambInfixOp, Data, Anno, …
Data (HsExpr GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsExpr GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsExpr GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsExpr (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphanCollectBinders [LocatedA (Stmt GhcTc (LocatedA (HsExpr GhcTc)))]Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.TicksDisambECP (HsExpr GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcessDisambInfixOp (HsExpr GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcessData (GRHS GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsMultAnnOf (LocatedA (HsExpr GhcPs)) GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsMultAnnOf (LocatedA (HsExpr GhcRn)) GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsMultAnnOf (LocatedA (HsExpr GhcTc)) GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (HsExpr (GhcPass p)) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (HsExpr (GhcPass p))] = SrcSpanAnnCDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsExpr (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Body (HsExpr GhcPs) = HsExprDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcesstype FunArg (HsExpr GhcPs) = HsExpr GhcPsDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcesstype InfixOp (HsExpr GhcPs) = HsExpr GhcPsDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcess
Constructors
Instances5Data, Outputable, Anno
Data (DotFieldOcc GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (DotFieldOcc GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (DotFieldOcc GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanUnXRec p => Outputable (DotFieldOcc p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (DotFieldOcc (GhcPass p)) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
A pragma, written as {-# ... #-}, that may appear within an expression.
Constructors
HsPragSCC (XSCC p) StringLiteralXHsPragE !(XXPragE p)
Instances4Data, Outputable
Data (HsPragE GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsPragE GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsPragE GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputable (HsPragE (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
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
Which kind of lambda case are we dealing with?
Instances3Eq, Data, Outputable
Eq HsLamVariantDefined in ghc-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.ExprData HsLamVariantDefined in ghc-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.ExprOutputable HsLamVariantDefined in ghc-lib-parser-9.14.1.20251220 · 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 [LHsCmdTop id]HsCmdApp (XCmdApp id) (LHsCmd id) (LHsExpr id)HsCmdLam (XCmdLamCase id) HsLamVariant (MatchGroup id (LHsCmd id))Lambda-case
HsCmdPar (XCmdPar id) (LHsCmd id)HsCmdCase (XCmdCase id) (LHsExpr id) (MatchGroup id (LHsCmd id))HsCmdIf (XCmdIf id) (SyntaxExpr id) (LHsExpr id) (LHsCmd id) (LHsCmd id)HsCmdLet (XCmdLet id) (HsLocalBinds id) (LHsCmd id)HsCmdDo (XCmdDo id) (XRec id [CmdLStmt id])XCmd !(XXCmd id)
Instances30Outputable, CollectBinders, DisambECP, Data, Anno, Body, …
Data (HsCmd GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsCmd GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsCmd GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsCmd (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphanCollectBinders [LocatedA (Stmt GhcTc (LocatedA (HsCmd GhcTc)))]Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.TicksDisambECP (HsCmd GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcessData (GRHS GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (HsCmd (GhcPass p)) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Body (HsCmd GhcPs) = HsCmdDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcesstype FunArg (HsCmd GhcPs) = HsExpr GhcPsDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcesstype InfixOp (HsCmd GhcPs) = HsExpr GhcPsDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.PostProcess
Haskell arrow application type.
Constructors
HsHigherOrderAppFirst order arrow application
-<HsFirstOrderAppHigher order arrow application
-<<
Instances1Data
Data HsArrAppTypeDefined in ghc-lib-parser-9.14.1.20251220 · 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
Instances5Data, Outputable, Anno
Data (HsCmdTop GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsCmdTop GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsCmdTop GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsCmdTop (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (HsCmdTop (GhcPass p)) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
Haskell Record Bindings
Constructors
MGXMatchGroup !(XXMatchGroup p body)
Instances6Data
Data (MatchGroup GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (MatchGroup GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan
Located Match
Instances13Data, Outputable, Anno, …
Data (Match GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (Match GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan(OutputableBndrId pr, Outputable body) => Outputable (Match (GhcPass pr) body)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (Match GhcPs (LocatedA (PatBuilder GhcPs))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.Typestype Anno (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match GhcPs (LocatedA (PatBuilder GhcPs)))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.Typestype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsCmd (GhcPass p))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (Match (GhcPass p) (LocatedA (HsExpr (GhcPass p))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
Guarded Right-Hand Sides
GRHSs are used both for pattern bindings and for Matches
Constructors
GRHSsgrhssExt :: XCGRHSs p bodygrhssGRHSs :: NonEmpty (LGRHS p body)Guarded RHSs
grhssLocalBinds :: HsLocalBinds pThe where clause
XGRHSs !(XXGRHSs p body)
Instances6Data
Data (GRHSs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHSs GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan
Located Guarded Right-Hand Side
Guarded Right Hand Side.
Constructors
GRHS (XCGRHS p body) [GuardLStmt p] bodyXGRHS !(XXGRHS p body)
Instances9Data, Anno, …
Data (GRHS GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (GRHS GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphantype Anno (GRHS GhcPs (LocatedA (PatBuilder GhcPs))) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.Typestype Anno (GRHS (GhcPass p) (LocatedA (HsCmd (GhcPass p)))) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (GRHS (GhcPass p) (LocatedA (HsExpr (GhcPass p)))) = EpAnnCODefined in ghc-lib-parser-9.14.1.20251220 · 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
Constructors
LastStmt (XLastStmt idL idR body) body (Maybe Bool) (SyntaxExpr idR)BindStmt (XBindStmt idL idR body) (LPat idL) bodyBodyStmt (XBodyStmt idL idR body) body (SyntaxExpr idR) (SyntaxExpr idR)LetStmt (XLetStmt idL idR body) (HsLocalBindsLR idL idR)ParStmt (XParStmt idL idR body) (NonEmpty (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)
Instances20CollectBinders, CollectFldBinders, Data, Outputable, Anno, …
CollectBinders [LocatedA (Stmt GhcTc (LocatedA (HsCmd GhcTc)))]Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.TicksCollectBinders [LocatedA (Stmt GhcTc (LocatedA (HsExpr GhcTc)))]Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.TicksCollectFldBinders (Stmt GhcTc e)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.TicksData (StmtLR GhcPs GhcPs (LocatedA (HsCmd GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcPs (LocatedA (HsExpr GhcPs)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcPs GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsCmd GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcRn GhcRn (LocatedA (HsExpr GhcRn)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsCmd GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (StmtLR GhcTc GhcTc (LocatedA (HsExpr GhcTc)))Defined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (StmtLR GhcPs GhcPs (LocatedA (PatBuilder GhcPs))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.Typestype Anno (StmtLR GhcRn GhcRn (LocatedA (body GhcRn))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr)))) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR GhcPs GhcPs (LocatedA (PatBuilder GhcPs)))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Parser.Typestype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsCmd (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (HsExpr (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphantype Anno [LocatedA (StmtLR (GhcPass pl) (GhcPass pr) (LocatedA (body (GhcPass pr))))] = SrcSpanAnnLWDefined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcPs GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcRn GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (ParStmtBlock GhcTc GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · 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.
Haskell Splice
Constructors
HsUntypedSpliceExpr (XUntypedSpliceExpr id) (LHsExpr id)HsQuasiQuote (XQuasiQuote id) (LIdP id) (XRec id FastString)XUntypedSplice !(XXUntypedSplice id)
Instances4Data, Anno
Data (HsUntypedSplice GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsUntypedSplice GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsUntypedSplice GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphantype Anno (HsUntypedSplice (GhcPass p)) = SrcSpanAnnADefined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
Constructors
HsTypedSpliceExpr (XTypedSpliceExpr id) (LHsExpr id)XTypedSplice !(XXTypedSplice id)
Instances3Data
Data (HsTypedSplice GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsTypedSplice GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsTypedSplice GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphan
Haskell (Untyped) Quote = Expr + Pat + Type + Var
Instances4Data, Outputable
Data (HsQuote GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsQuote GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (HsQuote GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (HsQuote (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
Arithmetic Sequence Information
Instances4Data, Outputable
Data (ArithSeqInfo GhcPs)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (ArithSeqInfo GhcRn)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanData (ArithSeqInfo GhcTc)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputableBndrId p => Outputable (ArithSeqInfo (GhcPass p))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.Hs.Expr · orphan
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]mc_an :: XFunRhs
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-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputable fn => Outputable (HsMatchContext fn)Defined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputable fn => Outputable (HsStmtContext fn)Defined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · GHC.Hs.Instances · orphanOutputable HsArrowMatchContextDefined in ghc-lib-parser-9.14.1.20251220 · 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-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.ExprData HsDoFlavourDefined in ghc-lib-parser-9.14.1.20251220 · Language.Haskell.Syntax.Expr
Is this a monadic context?