Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data SumOrTuple b
- pprSumOrTuple :: Outputable b => Boxity -> SumOrTuple b -> SDoc
- data PatBuilder p
- = PatBuilderPat (Pat p)
- | PatBuilderPar (LocatedA (PatBuilder p)) AnnParen
- | PatBuilderApp (LocatedA (PatBuilder p)) (LocatedA (PatBuilder p))
- | PatBuilderAppType (LocatedA (PatBuilder p)) SrcSpan (HsPatSigType GhcPs)
- | PatBuilderOpApp (LocatedA (PatBuilder p)) (LocatedN RdrName) (LocatedA (PatBuilder p)) EpAnn
- | PatBuilderVar (LocatedN RdrName)
- | PatBuilderOverLit (HsOverLit GhcPs)
- data DataConBuilder
Documentation
data SumOrTuple b Source #
pprSumOrTuple :: Outputable b => Boxity -> SumOrTuple b -> SDoc Source #
data PatBuilder p Source #
See Note [Ambiguous syntactic categories] and Note [PatBuilder]
PatBuilderPat (Pat p) | |
PatBuilderPar (LocatedA (PatBuilder p)) AnnParen | |
PatBuilderApp (LocatedA (PatBuilder p)) (LocatedA (PatBuilder p)) | |
PatBuilderAppType (LocatedA (PatBuilder p)) SrcSpan (HsPatSigType GhcPs) | |
PatBuilderOpApp (LocatedA (PatBuilder p)) (LocatedN RdrName) (LocatedA (PatBuilder p)) EpAnn | |
PatBuilderVar (LocatedN RdrName) | |
PatBuilderOverLit (HsOverLit GhcPs) |
Instances
data DataConBuilder Source #
An accumulator to build a prefix data constructor,
e.g. when parsing MkT A B C
, the accumulator will evolve as follows:
1. PrefixDataConBuilder [] MkT 2. PrefixDataConBuilder [A] MkT 3. PrefixDataConBuilder [A, B] MkT 4. PrefixDataConBuilder [A, B, C] MkT
There are two reasons we have a separate builder type instead of using
HsConDeclDetails GhcPs
directly:
- It's faster, because
OrdList
gives us constant-time snoc. - Having a separate type helps ensure that we don't forget to finalize a
RecTy
into aRecCon
(we do that indataConBuilderDetails
).
See Note [PatBuilder] for another builder type used in the parser. Here the technique is similar, but the motivation is different.
PrefixDataConBuilder (OrdList (LHsType GhcPs)) (LocatedN RdrName) | |
InfixDataConBuilder (LHsType GhcPs) (LocatedN RdrName) (LHsType GhcPs) |
Instances
DisambTD DataConBuilder # | |
Defined in GHC.Parser.PostProcess mkHsAppTyHeadPV :: LHsType GhcPs -> PV (LocatedA DataConBuilder) Source # mkHsAppTyPV :: LocatedA DataConBuilder -> LHsType GhcPs -> PV (LocatedA DataConBuilder) Source # mkHsAppKindTyPV :: LocatedA DataConBuilder -> SrcSpan -> LHsType GhcPs -> PV (LocatedA DataConBuilder) Source # mkHsOpTyPV :: LHsType GhcPs -> LocatedN RdrName -> LHsType GhcPs -> PV (LocatedA DataConBuilder) Source # mkUnpackednessPV :: Located UnpackednessPragma -> LocatedA DataConBuilder -> PV (LocatedA DataConBuilder) Source # | |
Outputable DataConBuilder # | |
Defined in GHC.Parser.Types ppr :: DataConBuilder -> SDoc Source # |