HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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
newtypenewtype FieldLabelStrings p
#

Constructors

Instances7Data, Outputable, OutputableBndr, Anno, …
datadata LHsRecUpdFields p where
#

Haskell Record Update Fields.

Instances3Data

Expressions proper

52 declarations
familytype family SyntaxExpr p
#

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
datadata HsExpr p
#

A Haskell expression.

Constructors

Instances32Outputable, HasType, ToHie, DisambECP, DisambInfixOp, Data, …
datadata DotFieldOcc p
#
Instances5Data, Outputable, Anno
datadata HsPragE p
#

A pragma, written as {-# ... #-}, that may appear within an expression.

Instances4Data, Outputable
typetype LHsTupArg id = XRec id (HsTupArg id)
#

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))

datadata HsTupArg id
#

Haskell Tuple Argument

Constructors

Instances4Data, ToHie
typetype LHsCmd id = XRec id (HsCmd id)
#

Located Haskell Command (for arrow syntax)

datadata HsCmd id
#
Instances32Outputable, ToHie, DisambECP, Data, Anno, Body, …
typetype LHsCmdTop p = XRec p (HsCmdTop p)
#

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

datadata HsCmdTop p
#

Haskell Top-level Command

Constructors

Instances6Data, Outputable, ToHie, Anno
datadata MatchGroup p body
#

Constructors

Instances7Data, ToHie, …
datadata Match p body
#

Constructors

Instances14ToHie, Data, Outputable, Anno, …
datadata GRHSs p body
#

Guarded Right-Hand Sides

GRHSs are used both for pattern bindings and for Matches

Constructors

Instances7Data, ToHie, …
typetype LGRHS id body = XRec id (GRHS id body)
#

Located Guarded Right-Hand Side

datadata GRHS p body
#

Guarded Right Hand Side.

Constructors

Instances10Data, ToHie, Anno, …
typetype LStmt id body = XRec id (StmtLR id id body)
#

Located do block Statement

typetype LStmtLR idL idR body = XRec idL (StmtLR idL idR body)
#

Located Statement with separate Left and Right id's

typetype Stmt id body = StmtLR id id body
#

do block Statement

datadata StmtLR idL idR body
#

Exact print annotations when in qualifier lists or guards - AnnKeywordId : AnnVbar, AnnComma,AnnThen, AnnBy,AnnBy, AnnGroup,AnnUsing

Constructors

Instances20ToHie, Data, Outputable, Anno, …
datadata ParStmtBlock idL idR
#

Parenthesised Statement Block

Constructors

Instances5Data, Outputable
typetype FailOperator id = Maybe (SyntaxExpr id)
#

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.

datadata ApplicativeArg idL
#

Applicative Argument

Constructors

Instances5Data, Outputable, ToHie
datadata HsUntypedSplice id
#
Instances5Data, ToHie, Anno
datadata HsQuote p
#

Haskell (Untyped) Quote = Expr + Pat + Type + Var

Instances5Data, Outputable, ToHie
datadata ArithSeqInfo id
#

Arithmetic Sequence Information

Constructors

Instances5Data, Outputable, ToHie
datadata HsMatchContext fn
#

Haskell Match Context

Context of a pattern match. This is more subtle than it would seem. See Note [FunBind vs PatBind].

Constructors

Instances2Data, Outputable
datadata HsStmtContext fn
#

Haskell Statement Context.

Constructors

Instances2Data, Outputable