Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abstract Haskell syntax for expressions.
- type LHsExpr id = Located (HsExpr id)
- type PostTcExpr = HsExpr Id
- type PostTcTable = [(Name, PostTcExpr)]
- noPostTcExpr :: PostTcExpr
- noPostTcTable :: PostTcTable
- data SyntaxExpr id = SyntaxExpr {
- syn_expr :: HsExpr id
- syn_arg_wraps :: [HsWrapper]
- syn_res_wrap :: HsWrapper
- noExpr :: HsExpr id
- noSyntaxExpr :: SyntaxExpr id
- mkRnSyntaxExpr :: Name -> SyntaxExpr Name
- type CmdSyntaxTable id = [(Name, HsExpr id)]
- data UnboundVar
- unboundVarOcc :: UnboundVar -> OccName
- data HsExpr id
- = HsVar (Located id)
- | HsUnboundVar UnboundVar
- | HsConLikeOut ConLike
- | HsRecFld (AmbiguousFieldOcc id)
- | HsOverLabel (Maybe id) FastString
- | HsIPVar HsIPName
- | HsOverLit (HsOverLit id)
- | HsLit HsLit
- | HsLam (MatchGroup id (LHsExpr id))
- | HsLamCase (MatchGroup id (LHsExpr id))
- | HsApp (LHsExpr id) (LHsExpr id)
- | HsAppType (LHsExpr id) (LHsWcType id)
- | HsAppTypeOut (LHsExpr id) (LHsWcType Name)
- | OpApp (LHsExpr id) (LHsExpr id) (PostRn id Fixity) (LHsExpr id)
- | NegApp (LHsExpr id) (SyntaxExpr id)
- | HsPar (LHsExpr id)
- | SectionL (LHsExpr id) (LHsExpr id)
- | SectionR (LHsExpr id) (LHsExpr id)
- | ExplicitTuple [LHsTupArg id] Boxity
- | ExplicitSum ConTag Arity (LHsExpr id) (PostTc id [Type])
- | HsCase (LHsExpr id) (MatchGroup id (LHsExpr id))
- | HsIf (Maybe (SyntaxExpr id)) (LHsExpr id) (LHsExpr id) (LHsExpr id)
- | HsMultiIf (PostTc id Type) [LGRHS id (LHsExpr id)]
- | HsLet (LHsLocalBinds id) (LHsExpr id)
- | HsDo (HsStmtContext Name) (Located [ExprLStmt id]) (PostTc id Type)
- | ExplicitList (PostTc id Type) (Maybe (SyntaxExpr id)) [LHsExpr id]
- | ExplicitPArr (PostTc id Type) [LHsExpr id]
- | RecordCon {
- rcon_con_name :: Located id
- rcon_con_like :: PostTc id ConLike
- rcon_con_expr :: PostTcExpr
- rcon_flds :: HsRecordBinds id
- | RecordUpd { }
- | ExprWithTySig (LHsExpr id) (LHsSigWcType id)
- | ExprWithTySigOut (LHsExpr id) (LHsSigWcType Name)
- | ArithSeq PostTcExpr (Maybe (SyntaxExpr id)) (ArithSeqInfo id)
- | PArrSeq PostTcExpr (ArithSeqInfo id)
- | HsSCC SourceText StringLiteral (LHsExpr id)
- | HsCoreAnn SourceText StringLiteral (LHsExpr id)
- | HsBracket (HsBracket id)
- | HsRnBracketOut (HsBracket Name) [PendingRnSplice]
- | HsTcBracketOut (HsBracket Name) [PendingTcSplice]
- | HsSpliceE (HsSplice id)
- | HsProc (LPat id) (LHsCmdTop id)
- | HsStatic (PostRn id NameSet) (LHsExpr id)
- | HsArrApp (LHsExpr id) (LHsExpr id) (PostTc id Type) HsArrAppType Bool
- | HsArrForm (LHsExpr id) (Maybe Fixity) [LHsCmdTop id]
- | HsTick (Tickish id) (LHsExpr id)
- | HsBinTick Int Int (LHsExpr id)
- | HsTickPragma SourceText (StringLiteral, (Int, Int), (Int, Int)) ((SourceText, SourceText), (SourceText, SourceText)) (LHsExpr id)
- | EWildPat
- | EAsPat (Located id) (LHsExpr id)
- | EViewPat (LHsExpr id) (LHsExpr id)
- | ELazyPat (LHsExpr id)
- | HsWrap HsWrapper (HsExpr id)
- type LHsTupArg id = Located (HsTupArg id)
- data HsTupArg id
- tupArgPresent :: LHsTupArg id -> Bool
- pprLExpr :: OutputableBndrId id => LHsExpr id -> SDoc
- pprExpr :: OutputableBndrId id => HsExpr id -> SDoc
- isQuietHsExpr :: HsExpr id -> Bool
- pprBinds :: (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR idL idR -> SDoc
- ppr_lexpr :: OutputableBndrId id => LHsExpr id -> SDoc
- ppr_expr :: forall id. OutputableBndrId id => HsExpr id -> SDoc
- data LHsWcTypeX = OutputableBndrId id => LHsWcTypeX (LHsWcType id)
- ppr_apps :: OutputableBndrId id => HsExpr id -> [Either (LHsExpr id) LHsWcTypeX] -> SDoc
- pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
- pprDebugParendExpr :: OutputableBndrId id => LHsExpr id -> SDoc
- pprParendLExpr :: OutputableBndrId id => LHsExpr id -> SDoc
- pprParendExpr :: OutputableBndrId id => HsExpr id -> SDoc
- hsExprNeedsParens :: HsExpr id -> Bool
- isAtomicHsExpr :: HsExpr id -> Bool
- type LHsCmd id = Located (HsCmd id)
- data HsCmd id
- = HsCmdArrApp (LHsExpr id) (LHsExpr id) (PostTc id Type) HsArrAppType Bool
- | HsCmdArrForm (LHsExpr id) LexicalFixity (Maybe Fixity) [LHsCmdTop id]
- | HsCmdApp (LHsCmd id) (LHsExpr id)
- | HsCmdLam (MatchGroup id (LHsCmd id))
- | HsCmdPar (LHsCmd id)
- | HsCmdCase (LHsExpr id) (MatchGroup id (LHsCmd id))
- | HsCmdIf (Maybe (SyntaxExpr id)) (LHsExpr id) (LHsCmd id) (LHsCmd id)
- | HsCmdLet (LHsLocalBinds id) (LHsCmd id)
- | HsCmdDo (Located [CmdLStmt id]) (PostTc id Type)
- | HsCmdWrap HsWrapper (HsCmd id)
- data HsArrAppType
- type LHsCmdTop id = Located (HsCmdTop id)
- data HsCmdTop id = HsCmdTop (LHsCmd id) (PostTc id Type) (PostTc id Type) (CmdSyntaxTable id)
- pprLCmd :: OutputableBndrId id => LHsCmd id -> SDoc
- pprCmd :: OutputableBndrId id => HsCmd id -> SDoc
- isQuietHsCmd :: HsCmd id -> Bool
- ppr_lcmd :: OutputableBndrId id => LHsCmd id -> SDoc
- ppr_cmd :: forall id. OutputableBndrId id => HsCmd id -> SDoc
- pprCmdArg :: OutputableBndrId id => HsCmdTop id -> SDoc
- type HsRecordBinds id = HsRecFields id (LHsExpr id)
- data MatchGroup id body = MG {}
- type LMatch id body = Located (Match id body)
- data Match id body = Match {
- m_ctxt :: HsMatchContext (NameOrRdrName id)
- m_pats :: [LPat id]
- m_type :: Maybe (LHsType id)
- m_grhss :: GRHSs id body
- isInfixMatch :: Match id body -> Bool
- isEmptyMatchGroup :: MatchGroup id body -> Bool
- isSingletonMatchGroup :: [LMatch id body] -> Bool
- matchGroupArity :: MatchGroup id body -> Arity
- hsLMatchPats :: LMatch id body -> [LPat id]
- data GRHSs id body = GRHSs {
- grhssGRHSs :: [LGRHS id body]
- grhssLocalBinds :: LHsLocalBinds id
- type LGRHS id body = Located (GRHS id body)
- data GRHS id body = GRHS [GuardLStmt id] body
- pprMatches :: (OutputableBndrId idR, Outputable body) => MatchGroup idR body -> SDoc
- pprFunBind :: (OutputableBndrId idR, Outputable body) => MatchGroup idR body -> SDoc
- pprPatBind :: forall bndr id body. (OutputableBndrId bndr, OutputableBndrId id, Outputable body) => LPat bndr -> GRHSs id body -> SDoc
- pprMatch :: (OutputableBndrId idR, Outputable body) => Match idR body -> SDoc
- pprGRHSs :: (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHSs idR body -> SDoc
- pprGRHS :: (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHS idR body -> SDoc
- pp_rhs :: Outputable body => HsMatchContext idL -> body -> SDoc
- type LStmt id body = Located (StmtLR id id body)
- type LStmtLR idL idR body = Located (StmtLR idL idR body)
- type Stmt id body = StmtLR id id body
- type CmdLStmt id = LStmt id (LHsCmd id)
- type CmdStmt id = Stmt id (LHsCmd id)
- type ExprLStmt id = LStmt id (LHsExpr id)
- type ExprStmt id = Stmt id (LHsExpr id)
- type GuardLStmt id = LStmt id (LHsExpr id)
- type GuardStmt id = Stmt id (LHsExpr id)
- type GhciLStmt id = LStmt id (LHsExpr id)
- type GhciStmt id = Stmt id (LHsExpr id)
- data StmtLR idL idR body
- = LastStmt body Bool (SyntaxExpr idR)
- | BindStmt (LPat idL) body (SyntaxExpr idR) (SyntaxExpr idR) (PostTc idR Type)
- | ApplicativeStmt [(SyntaxExpr idR, ApplicativeArg idL idR)] (Maybe (SyntaxExpr idR)) (PostTc idR Type)
- | BodyStmt body (SyntaxExpr idR) (SyntaxExpr idR) (PostTc idR Type)
- | LetStmt (LHsLocalBindsLR idL idR)
- | ParStmt [ParStmtBlock idL idR] (HsExpr idR) (SyntaxExpr idR) (PostTc idR Type)
- | TransStmt { }
- | RecStmt {
- recS_stmts :: [LStmtLR idL idR body]
- recS_later_ids :: [idR]
- recS_rec_ids :: [idR]
- recS_bind_fn :: SyntaxExpr idR
- recS_ret_fn :: SyntaxExpr idR
- recS_mfix_fn :: SyntaxExpr idR
- recS_bind_ty :: PostTc idR Type
- recS_later_rets :: [PostTcExpr]
- recS_rec_rets :: [PostTcExpr]
- recS_ret_ty :: PostTc idR Type
- data TransForm
- data ParStmtBlock idL idR = ParStmtBlock [ExprLStmt idL] [idR] (SyntaxExpr idR)
- data ApplicativeArg idL idR
- = ApplicativeArgOne (LPat idL) (LHsExpr idL)
- | ApplicativeArgMany [ExprLStmt idL] (HsExpr idL) (LPat idL)
- pprStmt :: forall idL idR body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => StmtLR idL idR body -> SDoc
- pprTransformStmt :: OutputableBndrId id => [id] -> LHsExpr id -> Maybe (LHsExpr id) -> SDoc
- pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc
- pprBy :: Outputable body => Maybe body -> SDoc
- pprDo :: (OutputableBndrId id, Outputable body) => HsStmtContext any -> [LStmt id body] -> SDoc
- ppr_do_stmts :: (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => [LStmtLR idL idR body] -> SDoc
- pprComp :: (OutputableBndrId id, Outputable body) => [LStmt id body] -> SDoc
- pprQuals :: (OutputableBndrId id, Outputable body) => [LStmt id body] -> SDoc
- data HsSplice id
- = HsTypedSplice SpliceDecoration id (LHsExpr id)
- | HsUntypedSplice SpliceDecoration id (LHsExpr id)
- | HsQuasiQuote id id SrcSpan FastString
- | HsSpliced ThModFinalizers (HsSplicedThing id)
- data SpliceDecoration
- isTypedSplice :: HsSplice id -> Bool
- newtype ThModFinalizers = ThModFinalizers [ForeignRef (Q ())]
- data HsSplicedThing id
- = HsSplicedExpr (HsExpr id)
- | HsSplicedTy (HsType id)
- | HsSplicedPat (Pat id)
- type SplicePointName = Name
- data PendingRnSplice = PendingRnSplice UntypedSpliceFlavour SplicePointName (LHsExpr Name)
- data UntypedSpliceFlavour
- data PendingTcSplice = PendingTcSplice SplicePointName (LHsExpr Id)
- pprPendingSplice :: OutputableBndrId id => SplicePointName -> LHsExpr id -> SDoc
- pprSpliceDecl :: OutputableBndrId id => HsSplice id -> SpliceExplicitFlag -> SDoc
- ppr_splice_decl :: OutputableBndrId id => HsSplice id -> SDoc
- pprSplice :: OutputableBndrId id => HsSplice id -> SDoc
- ppr_quasi :: OutputableBndr id => id -> id -> FastString -> SDoc
- ppr_splice :: OutputableBndrId id => SDoc -> id -> LHsExpr id -> SDoc -> SDoc
- data HsBracket id
- isTypedBracket :: HsBracket id -> Bool
- pprHsBracket :: OutputableBndrId id => HsBracket id -> SDoc
- thBrackets :: SDoc -> SDoc -> SDoc
- thTyBrackets :: SDoc -> SDoc
- data ArithSeqInfo id
- pp_dotdot :: SDoc
- data HsMatchContext id
- = FunRhs { }
- | LambdaExpr
- | CaseAlt
- | IfAlt
- | ProcExpr
- | PatBindRhs
- | RecUpd
- | StmtCtxt (HsStmtContext id)
- | ThPatSplice
- | ThPatQuote
- | PatSyn
- isPatSynCtxt :: HsMatchContext id -> Bool
- data HsStmtContext id
- = ListComp
- | MonadComp
- | PArrComp
- | DoExpr
- | MDoExpr
- | ArrowExpr
- | GhciStmtCtxt
- | PatGuard (HsMatchContext id)
- | ParStmtCtxt (HsStmtContext id)
- | TransStmtCtxt (HsStmtContext id)
- isListCompExpr :: HsStmtContext id -> Bool
- isMonadCompExpr :: HsStmtContext id -> Bool
- isMonadFailStmtContext :: HsStmtContext id -> Bool
- matchSeparator :: HsMatchContext id -> SDoc
- pprMatchContext :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
- pprMatchContextNoun :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
- pprAStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
- pprStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
- matchContextErrString :: Outputable id => HsMatchContext id -> SDoc
- pprMatchInCtxt :: (OutputableBndrId idR, Outputable (NameOrRdrName (NameOrRdrName idR)), Outputable body) => Match idR body -> SDoc
- pprStmtInCtxt :: (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => HsStmtContext idL -> StmtLR idL idR body -> SDoc
Expressions proper
= Located (HsExpr id) | May have |
Located Haskell Expression
type PostTcExpr = HsExpr Id Source #
Post-Type checking Expression
PostTcExpr is an evidence expression attached to the syntax tree by the type checker (c.f. postTcType).
type PostTcTable = [(Name, PostTcExpr)] Source #
Post-Type checking Table
We use a PostTcTable where there are a bunch of pieces of evidence, more than is convenient to keep individually.
data SyntaxExpr id Source #
Syntax Expression
SyntaxExpr is like PostTcExpr
, but it's filled in a little earlier,
by the renamer. It's used for rebindable syntax.
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
This should desugar to
syn_res_wrap $ syn_expr (syn_arg_wraps[0] arg0) (syn_arg_wraps[1] arg1) ...
where the actual arguments come from elsewhere in the AST.
This could be defined using PostRn
and PostTc
and such, but it's
harder to get it all to work out that way. (noSyntaxExpr
is hard to
write, for example.)
SyntaxExpr | |
|
DataId id => Data (SyntaxExpr id) # | |
OutputableBndrId id => Outputable (SyntaxExpr id) # | |
This is used for rebindable-syntax pieces that are too polymorphic for tcSyntaxOp (trS_fmap and the mzip in ParStmt)
noSyntaxExpr :: SyntaxExpr id Source #
mkRnSyntaxExpr :: Name -> SyntaxExpr Name Source #
Make a 'SyntaxExpr Name' (the "rn" is because this is used in the renamer), missing its HsWrappers.
type CmdSyntaxTable id = [(Name, HsExpr id)] Source #
Command Syntax Table (for Arrow syntax)
data UnboundVar Source #
An unbound variable; used for treating out-of-scope variables as expression holes
OutOfScope OccName GlobalRdrEnv | An (unqualified) out-of-scope variable, together with the GlobalRdrEnv with respect to which it is unbound |
TrueExprHole OccName | A "true" expression hole (_ or _x) |
unboundVarOcc :: UnboundVar -> OccName Source #
A Haskell expression.
HsVar (Located id) | Variable |
HsUnboundVar UnboundVar | Unbound 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. Turned into HsVar by type checker, to support deferred type errors. |
HsConLikeOut ConLike | After typechecker only; must be different HsVar for pretty printing |
HsRecFld (AmbiguousFieldOcc id) | Variable pointing to record selector Not in use after typechecking |
HsOverLabel (Maybe id) FastString | Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels)
|
HsIPVar HsIPName | Implicit parameter (not in use after typechecking) |
HsOverLit (HsOverLit id) | Overloaded literals |
HsLit HsLit | Simple (non-overloaded) literals |
HsLam (MatchGroup id (LHsExpr id)) | Lambda abstraction. Currently always a single match |
HsLamCase (MatchGroup id (LHsExpr id)) | Lambda-case |
HsApp (LHsExpr id) (LHsExpr id) | Application |
HsAppType (LHsExpr id) (LHsWcType id) | Visible type application Explicit type argument; e.g f @Int x y NB: Has wildcards, but no implicit quantification |
HsAppTypeOut (LHsExpr id) (LHsWcType Name) | |
OpApp (LHsExpr id) (LHsExpr id) (PostRn id Fixity) (LHsExpr id) | Operator applications: NB Bracketed ops such as (+) come out as Vars. |
NegApp (LHsExpr id) (SyntaxExpr id) | Negation operator. Contains the negated expression and the name
of |
HsPar (LHsExpr id) | Parenthesised expr; see Note [Parens in HsSyn] |
SectionL (LHsExpr id) (LHsExpr id) | |
SectionR (LHsExpr id) (LHsExpr id) | |
ExplicitTuple [LHsTupArg id] Boxity | Used for explicit tuples and sections thereof |
ExplicitSum ConTag Arity (LHsExpr id) (PostTc id [Type]) | Used for unboxed sum types
There will be multiple |
HsCase (LHsExpr id) (MatchGroup id (LHsExpr id)) |
|
HsIf (Maybe (SyntaxExpr id)) (LHsExpr id) (LHsExpr id) (LHsExpr id) | |
HsMultiIf (PostTc id Type) [LGRHS id (LHsExpr id)] | Multi-way if |
HsLet (LHsLocalBinds id) (LHsExpr id) | let(rec)
|
HsDo (HsStmtContext Name) (Located [ExprLStmt id]) (PostTc id Type) | |
ExplicitList (PostTc id Type) (Maybe (SyntaxExpr id)) [LHsExpr id] | Syntactic list: [a,b,c,...]
|
ExplicitPArr (PostTc id Type) [LHsExpr id] | Syntactic parallel array: [:e1, ..., en:] |
RecordCon | Record construction
|
| |
RecordUpd | Record update
|
ExprWithTySig (LHsExpr id) (LHsSigWcType id) | Expression with an explicit type signature. |
ExprWithTySigOut (LHsExpr id) (LHsSigWcType Name) | |
ArithSeq PostTcExpr (Maybe (SyntaxExpr id)) (ArithSeqInfo id) | Arithmetic sequence
|
PArrSeq PostTcExpr (ArithSeqInfo id) | Arithmetic sequence for parallel array [:e1..e2:] or [:e1, e2..e3:] |
HsSCC SourceText StringLiteral (LHsExpr id) |
|
HsCoreAnn SourceText StringLiteral (LHsExpr id) |
|
HsBracket (HsBracket id) | |
HsRnBracketOut (HsBracket Name) [PendingRnSplice] | |
HsTcBracketOut (HsBracket Name) [PendingTcSplice] | |
HsSpliceE (HsSplice id) | |
HsProc (LPat id) (LHsCmdTop id) |
|
HsStatic (PostRn id NameSet) (LHsExpr id) | |
HsArrApp (LHsExpr id) (LHsExpr id) (PostTc id Type) HsArrAppType Bool | |
HsArrForm (LHsExpr id) (Maybe Fixity) [LHsCmdTop id] |
|
HsTick (Tickish id) (LHsExpr id) | |
HsBinTick Int Int (LHsExpr id) | |
HsTickPragma SourceText (StringLiteral, (Int, Int), (Int, Int)) ((SourceText, SourceText), (SourceText, SourceText)) (LHsExpr id) | |
EWildPat | |
EAsPat (Located id) (LHsExpr id) | |
EViewPat (LHsExpr id) (LHsExpr id) | |
ELazyPat (LHsExpr id) | |
HsWrap HsWrapper (HsExpr id) |
DataId id => Data (HsExpr id) # | |
OutputableBndrId id => Outputable (HsExpr id) # | |
type LHsTupArg id = Located (HsTupArg id) Source #
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
tupArgPresent :: LHsTupArg id -> Bool Source #
isQuietHsExpr :: HsExpr id -> Bool Source #
pprBinds :: (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR idL idR -> SDoc Source #
data LHsWcTypeX Source #
Located Haskell Wildcard Type Expression
OutputableBndrId id => LHsWcTypeX (LHsWcType id) |
ppr_apps :: OutputableBndrId id => HsExpr id -> [Either (LHsExpr id) LHsWcTypeX] -> SDoc Source #
pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc Source #
pprDebugParendExpr :: OutputableBndrId id => LHsExpr id -> SDoc Source #
pprParendLExpr :: OutputableBndrId id => LHsExpr id -> SDoc Source #
pprParendExpr :: OutputableBndrId id => HsExpr id -> SDoc Source #
hsExprNeedsParens :: HsExpr id -> Bool Source #
isAtomicHsExpr :: HsExpr id -> Bool Source #
Haskell Command (e.g. a "statement" in an Arrow proc block)
HsCmdArrApp (LHsExpr id) (LHsExpr id) (PostTc id Type) HsArrAppType Bool | |
HsCmdArrForm (LHsExpr id) LexicalFixity (Maybe Fixity) [LHsCmdTop id] |
|
HsCmdApp (LHsCmd id) (LHsExpr id) | |
HsCmdLam (MatchGroup id (LHsCmd id)) | |
HsCmdPar (LHsCmd id) |
|
HsCmdCase (LHsExpr id) (MatchGroup id (LHsCmd id)) |
|
HsCmdIf (Maybe (SyntaxExpr id)) (LHsExpr id) (LHsCmd id) (LHsCmd id) | |
HsCmdLet (LHsLocalBinds id) (LHsCmd id) |
|
HsCmdDo (Located [CmdLStmt id]) (PostTc id Type) | |
HsCmdWrap HsWrapper (HsCmd id) |
DataId id => Data (HsCmd id) # | |
OutputableBndrId id => Outputable (HsCmd id) # | |
data HsArrAppType Source #
Haskell Array Application Type
type LHsCmdTop id = Located (HsCmdTop id) Source #
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
Haskell Top-level Command
DataId id => Data (HsCmdTop id) # | |
OutputableBndrId id => Outputable (HsCmdTop id) # | |
isQuietHsCmd :: HsCmd id -> Bool Source #
type HsRecordBinds id = HsRecFields id (LHsExpr id) Source #
Haskell Record Bindings
type LMatch id body = Located (Match id body) Source #
Located Match
May have AnnKeywordId
: AnnSemi
when in a
list
Match | |
|
(Data body, DataId id) => Data (Match id body) # | |
(OutputableBndrId idR, Outputable body) => Outputable (Match idR body) # | |
isInfixMatch :: Match id body -> Bool Source #
isEmptyMatchGroup :: MatchGroup id body -> Bool Source #
isSingletonMatchGroup :: [LMatch id body] -> Bool Source #
Is there only one RHS in this list of matches?
matchGroupArity :: MatchGroup id body -> Arity Source #
hsLMatchPats :: LMatch id body -> [LPat id] Source #
Guarded Right-Hand Sides
GRHSs are used both for pattern bindings and for Matches
GRHSs | |
|
Guarded Right Hand Side.
GRHS [GuardLStmt id] body |
pprMatches :: (OutputableBndrId idR, Outputable body) => MatchGroup idR body -> SDoc Source #
pprFunBind :: (OutputableBndrId idR, Outputable body) => MatchGroup idR body -> SDoc Source #
pprPatBind :: forall bndr id body. (OutputableBndrId bndr, OutputableBndrId id, Outputable body) => LPat bndr -> GRHSs id body -> SDoc Source #
pprMatch :: (OutputableBndrId idR, Outputable body) => Match idR body -> SDoc Source #
pprGRHSs :: (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHSs idR body -> SDoc Source #
pprGRHS :: (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHS idR body -> SDoc Source #
pp_rhs :: Outputable body => HsMatchContext idL -> body -> SDoc Source #
type LStmtLR idL idR body = Located (StmtLR idL idR body) Source #
Located Statement with separate Left and Right id's
type GuardLStmt id = LStmt id (LHsExpr id) Source #
Guard Located Statement
data StmtLR idL idR body Source #
API Annotations when in qualifier lists or guards
- AnnKeywordId
: AnnVbar
,
AnnComma
,AnnThen
,
AnnBy
,AnnBy
,
AnnGroup
,AnnUsing
LastStmt body Bool (SyntaxExpr idR) | |
BindStmt (LPat idL) body (SyntaxExpr idR) (SyntaxExpr idR) (PostTc idR Type) | |
ApplicativeStmt [(SyntaxExpr idR, ApplicativeArg idL idR)] (Maybe (SyntaxExpr idR)) (PostTc idR Type) |
For full details, see Note [ApplicativeDo] in RnExpr |
BodyStmt body (SyntaxExpr idR) (SyntaxExpr idR) (PostTc idR Type) | |
LetStmt (LHsLocalBindsLR idL idR) |
|
ParStmt [ParStmtBlock idL idR] (HsExpr idR) (SyntaxExpr idR) (PostTc idR Type) | |
TransStmt | |
RecStmt | |
|
(Data body, DataId idL, DataId idR) => Data (StmtLR idL idR body) # | |
(OutputableBndrId idL, OutputableBndrId idR, Outputable body) => Outputable (StmtLR idL idR body) # | |
data ParStmtBlock idL idR Source #
Parenthesised Statement Block
ParStmtBlock [ExprLStmt idL] [idR] (SyntaxExpr idR) |
(DataId idL, DataId idR) => Data (ParStmtBlock idL idR) # | |
OutputableBndrId idL => Outputable (ParStmtBlock idL idR) # | |
data ApplicativeArg idL idR Source #
Applicative Argument
ApplicativeArgOne (LPat idL) (LHsExpr idL) | |
ApplicativeArgMany [ExprLStmt idL] (HsExpr idL) (LPat idL) |
(DataId idL, DataId idR) => Data (ApplicativeArg idL idR) # | |
pprStmt :: forall idL idR body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => StmtLR idL idR body -> SDoc Source #
pprTransformStmt :: OutputableBndrId id => [id] -> LHsExpr id -> Maybe (LHsExpr id) -> SDoc Source #
pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc Source #
pprDo :: (OutputableBndrId id, Outputable body) => HsStmtContext any -> [LStmt id body] -> SDoc Source #
ppr_do_stmts :: (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => [LStmtLR idL idR body] -> SDoc Source #
pprComp :: (OutputableBndrId id, Outputable body) => [LStmt id body] -> SDoc Source #
pprQuals :: (OutputableBndrId id, Outputable body) => [LStmt id body] -> SDoc Source #
Haskell Splice
HsTypedSplice SpliceDecoration id (LHsExpr id) | |
HsUntypedSplice SpliceDecoration id (LHsExpr id) | |
HsQuasiQuote id id SrcSpan FastString | |
HsSpliced ThModFinalizers (HsSplicedThing id) |
DataId id => Data (HsSplice id) # | |
OutputableBndrId id => Outputable (HsSplice id) # | |
data SpliceDecoration Source #
A splice can appear with various decorations wrapped around it. This data type captures explicitly how it was originally written, for use in the pretty printer.
isTypedSplice :: HsSplice id -> Bool Source #
newtype ThModFinalizers Source #
Finalizers produced by a splice with
addModFinalizer
See Note [Delaying modFinalizers in untyped splices] in RnSplice. For how this is used.
ThModFinalizers [ForeignRef (Q ())] |
data HsSplicedThing id Source #
Haskell Spliced Thing
Values that can result from running a splice.
HsSplicedExpr (HsExpr id) | Haskell Spliced Expression |
HsSplicedTy (HsType id) | Haskell Spliced Type |
HsSplicedPat (Pat id) | Haskell Spliced Pattern |
DataId id => Data (HsSplicedThing id) # | |
OutputableBndrId id => Outputable (HsSplicedThing id) # | |
type SplicePointName = Name Source #
data PendingRnSplice Source #
Pending Renamer Splice
data UntypedSpliceFlavour Source #
data PendingTcSplice Source #
Pending Type-checker Splice
pprPendingSplice :: OutputableBndrId id => SplicePointName -> LHsExpr id -> SDoc Source #
pprSpliceDecl :: OutputableBndrId id => HsSplice id -> SpliceExplicitFlag -> SDoc Source #
ppr_splice_decl :: OutputableBndrId id => HsSplice id -> SDoc Source #
ppr_quasi :: OutputableBndr id => id -> id -> FastString -> SDoc Source #
ppr_splice :: OutputableBndrId id => SDoc -> id -> LHsExpr id -> SDoc -> SDoc Source #
Haskell Bracket
ExpBr (LHsExpr id) | |
PatBr (LPat id) | |
DecBrL [LHsDecl id] | |
DecBrG (HsGroup id) | |
TypBr (LHsType id) | |
VarBr Bool id | |
TExpBr (LHsExpr id) |
DataId id => Data (HsBracket id) # | |
OutputableBndrId id => Outputable (HsBracket id) # | |
isTypedBracket :: HsBracket id -> Bool Source #
pprHsBracket :: OutputableBndrId id => HsBracket id -> SDoc Source #
thTyBrackets :: SDoc -> SDoc Source #
data ArithSeqInfo id Source #
Arithmetic Sequence Information
From (LHsExpr id) | |
FromThen (LHsExpr id) (LHsExpr id) | |
FromTo (LHsExpr id) (LHsExpr id) | |
FromThenTo (LHsExpr id) (LHsExpr id) (LHsExpr id) |
DataId id => Data (ArithSeqInfo id) # | |
OutputableBndrId id => Outputable (ArithSeqInfo id) # | |
data HsMatchContext id Source #
Haskell Match Context
Context of a pattern match. This is more subtle than it would seem. See Note [Varieties of pattern matches].
FunRhs | A pattern matching on an argument of a function binding |
| |
LambdaExpr | Patterns of a lambda |
CaseAlt | Patterns and guards on a case alternative |
IfAlt | Guards of a multi-way if alternative |
ProcExpr | Patterns of a proc |
PatBindRhs | A pattern binding eg [y] <- e = e |
RecUpd | Record update [used only in DsExpr to tell matchWrapper what sort of runtime error message to generate] |
StmtCtxt (HsStmtContext id) | Pattern of a do-stmt, list comprehension, pattern guard, etc |
ThPatSplice | A Template Haskell pattern splice |
ThPatQuote | A Template Haskell pattern quotation [p| (a,b) |] |
PatSyn | A pattern synonym declaration |
Functor HsMatchContext # | |
DataIdPost id => Data (HsMatchContext id) # | |
OutputableBndr id => Outputable (HsMatchContext id) # | |
isPatSynCtxt :: HsMatchContext id -> Bool Source #
data HsStmtContext id Source #
Haskell Statement Context
ListComp | |
MonadComp | |
PArrComp | Parallel array comprehension |
DoExpr | do { ... } |
MDoExpr | mdo { ... } ie recursive do-expression |
ArrowExpr | do-notation in an arrow-command context |
GhciStmtCtxt | A command-line Stmt in GHCi pat <- rhs |
PatGuard (HsMatchContext id) | Pattern guard for specified thing |
ParStmtCtxt (HsStmtContext id) | A branch of a parallel stmt |
TransStmtCtxt (HsStmtContext id) | A branch of a transform stmt |
Functor HsStmtContext # | |
DataIdPost id => Data (HsStmtContext id) # | |
(Outputable id, Outputable (NameOrRdrName id)) => Outputable (HsStmtContext id) # | |
isListCompExpr :: HsStmtContext id -> Bool Source #
isMonadCompExpr :: HsStmtContext id -> Bool Source #
isMonadFailStmtContext :: HsStmtContext id -> Bool Source #
Should pattern match failure in a HsStmtContext
be desugared using
MonadFail
?
matchSeparator :: HsMatchContext id -> SDoc Source #
pprMatchContext :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc Source #
pprMatchContextNoun :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc Source #
pprAStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc Source #
pprStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc Source #
matchContextErrString :: Outputable id => HsMatchContext id -> SDoc Source #
pprMatchInCtxt :: (OutputableBndrId idR, Outputable (NameOrRdrName (NameOrRdrName idR)), Outputable body) => Match idR body -> SDoc Source #
pprStmtInCtxt :: (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => HsStmtContext idL -> StmtLR idL idR body -> SDoc Source #