ghc-9.0.0.20200925: The GHC API
Safe HaskellNone
LanguageHaskell2010

GHC.Parser.PostProcess

Synopsis

Documentation

mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs Source #

A useful function for building OpApps. The operator is always a variable, and we don't know the fixity yet.

mkTyClD :: LTyClDecl (GhcPass p) -> LHsDecl (GhcPass p) Source #

mkClassDecl builds a RdrClassDecl, filling in the names for tycon and datacon by deriving them from the name of the class. We fill in the names for the tycon and datacon corresponding to the class, by deriving them from the name of the class itself. This saves recording the names in the interface file (which would be equally good).

setRdrNameSpace :: RdrName -> NameSpace -> RdrName Source #

This rather gruesome function is used mainly by the parser. When parsing:

data T a = T | T1 Int

we parse the data constructors as types because of parser ambiguities, so then we need to change the type constr to a data constr

The exact-name case can occur when parsing:

data [] a = [] | a : [a]

For the exact-name case we return an original name.

filterCTuple :: RdrName -> RdrName Source #

Replaces constraint tuple names with corresponding boxed ones.

fromSpecTyVarBndr :: LHsTyVarBndr Specificity GhcPs -> P (LHsTyVarBndr () GhcPs) Source #

Converts LHsTyVarBndr annotated with its Specificity to one without annotations. Only accepts specified variables, and errors if the provided binder has an InferredSpec annotation.

fromSpecTyVarBndrs :: [LHsTyVarBndr Specificity GhcPs] -> P [LHsTyVarBndr () GhcPs] Source #

Converts a list of LHsTyVarBndrs annotated with their Specificity to binders without annotations. Only accepts specified variables, and errors if any of the provided binders has an InferredSpec annotation.

cvTopDecls :: OrdList (LHsDecl GhcPs) -> [LHsDecl GhcPs] Source #

Function definitions are restructured here. Each is assumed to be recursive initially, and non recursive definitions are discovered by the dependency analyser.

mkGadtDecl :: [Located RdrName] -> LHsType GhcPs -> P (ConDecl GhcPs) Source #

Construct a GADT-style data constructor from the constructor names and their type. Some interesting aspects of this function:

  • This splits up the constructor type into its quantified type variables (if provided), context (if provided), argument types, and result type, and records whether this is a prefix or record GADT constructor. See Note [GADT abstract syntax] in GHC.Hs.Decls for more details.
  • If -XLinearTypes is not enabled, the function arrows in a prefix GADT constructor are always interpreted as linear. If -XLinearTypes is enabled, we faithfully record whether -> or #-> was used.

checkExpBlockArguments :: LHsExpr GhcPs -> PV () Source #

Yield a parse error if we have a function applied directly to a do block etc. and BlockArguments is not enabled.

checkPrecP Source #

Arguments

:: Located (SourceText, Int)

precedence

-> Located (OrdList (Located RdrName))

operators

-> P () 

Check if a fixity is valid. We support bypassing the usual bound checks for some special operators.

checkContext :: LHsType GhcPs -> P ([AddAnn], LHsContext GhcPs) Source #

Validate the context constraints and break up a context into a list of predicates.

    (Eq a, Ord b)        -->  [Eq a, Ord b]
    Eq a                 -->  [Eq a]
    (Eq a)               -->  [Eq a]
    (((Eq a)))           -->  [Eq a]

checkMonadComp :: PV (HsStmtContext GhcRn) Source #

Check for monad comprehensions

If the flag MonadComprehensions is set, return a MonadComp context, otherwise use the usual ListComp context

data RuleTyTmVar Source #

Essentially a wrapper for a RuleBndr GhcPs

checkEmptyGADTs :: Located ([AddAnn], [LConDecl GhcPs]) -> P (Located ([AddAnn], [LConDecl GhcPs])) Source #

Check if the gadt_constrlist is empty. Only raise parse error for `data T where` to avoid affecting existing error message, see #8258.

addFatalError :: MonadP m => SrcSpan -> SDoc -> m a Source #

Add a fatal error. This will be the last error reported by the parser, and the parser will not produce any result, ending in a PFailed state.

hintBangPat :: SrcSpan -> Pat GhcPs -> PV () Source #

Hint about bang patterns, assuming BangPatterns is off.

data TyEl Source #

Either an operator or an operand.

Instances

Instances details
Outputable TyEl # 
Instance details

Defined in GHC.Parser.PostProcess

mergeOps :: [Located TyEl] -> P (LHsType GhcPs) Source #

Merge a reversed and non-empty soup of operators and operands into a type.

User input: F x y + G a b * X Input to mergeOps: [X, *, b, a, G, +, y, x, F] Output corresponds to what the user wrote assuming all operators are of the same fixity and right-associative.

It's a bit silly that we're doing it at all, as the renamer will have to rearrange this, and it'd be easier to keep things separate.

See Note [Parsing data constructors is hard]

mergeDataCon :: [Located TyEl] -> P (Located RdrName, HsConDeclDetails GhcPs) Source #

Merge a reversed and non-empty soup of operators and operands into a data constructor.

User input: C !A B -- ^ doc Input to mergeDataCon: ["doc", B, !A, C] Output: (C, PrefixCon [!A, B], "doc")

See Note [Parsing data constructors is hard]

data SumOrTuple b Source #

Constructors

Sum ConTag Arity (Located b) 
Tuple [Located (Maybe (Located b))] 

data PV a Source #

Instances

Instances details
Monad PV # 
Instance details

Defined in GHC.Parser.PostProcess

Methods

(>>=) :: PV a -> (a -> PV b) -> PV b Source #

(>>) :: PV a -> PV b -> PV b Source #

return :: a -> PV a Source #

Functor PV # 
Instance details

Defined in GHC.Parser.PostProcess

Methods

fmap :: (a -> b) -> PV a -> PV b Source #

(<$) :: a -> PV b -> PV a Source #

Applicative PV # 
Instance details

Defined in GHC.Parser.PostProcess

Methods

pure :: a -> PV a Source #

(<*>) :: PV (a -> b) -> PV a -> PV b Source #

liftA2 :: (a -> b -> c) -> PV a -> PV b -> PV c Source #

(*>) :: PV a -> PV b -> PV b Source #

(<*) :: PV a -> PV b -> PV a Source #

MonadP PV # 
Instance details

Defined in GHC.Parser.PostProcess

runPV :: PV a -> P a Source #

newtype ECP Source #

Constructors

ECP 

Fields

class b ~ Body b GhcPs => DisambECP b where Source #

Disambiguate constructs that may appear when we do not know ahead of time whether we are parsing an expression, a command, or a pattern. See Note [Ambiguous syntactic categories]

Associated Types

type Body b :: Type -> Type Source #

See Note [Body in DisambECP]

type InfixOp b Source #

Infix operator representation

type FunArg b Source #

Function argument representation

Methods

ecpFromCmd' :: LHsCmd GhcPs -> PV (Located b) Source #

Return a command without ambiguity, or fail in a non-command context.

ecpFromExp' :: LHsExpr GhcPs -> PV (Located b) Source #

Return an expression without ambiguity, or fail in a non-expression context.

mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located b) -> PV (Located b) Source #

Disambiguate "... -> ..." (lambda)

mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located b -> PV (Located b) Source #

Disambiguate "let ... in ..."

superInfixOp :: (DisambInfixOp (InfixOp b) => PV (Located b)) -> PV (Located b) Source #

Bring superclass constraints on InfixOp into scope. See Note [UndecidableSuperClasses for associated types]

mkHsOpAppPV :: SrcSpan -> Located b -> Located (InfixOp b) -> Located b -> PV (Located b) Source #

Disambiguate "f # x" (infix operator)

mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located b) -> PV (Located b) Source #

Disambiguate "case ... of ..."

mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located b) -> PV (Located b) Source #

Disambiguate \case ... (lambda case)

superFunArg :: (DisambECP (FunArg b) => PV (Located b)) -> PV (Located b) Source #

Bring superclass constraints on FunArg into scope. See Note [UndecidableSuperClasses for associated types]

mkHsAppPV :: SrcSpan -> Located b -> Located (FunArg b) -> PV (Located b) Source #

Disambiguate "f x" (function application)

mkHsAppTypePV :: SrcSpan -> Located b -> LHsType GhcPs -> PV (Located b) Source #

Disambiguate "f @t" (visible type application)

mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located b -> Bool -> Located b -> PV (Located b) Source #

Disambiguate "if ... then ... else ..."

mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located b)] -> PV (Located b) Source #

Disambiguate "do { ... }" (do notation)

mkHsParPV :: SrcSpan -> Located b -> PV (Located b) Source #

Disambiguate "( ... )" (parentheses)

mkHsVarPV :: Located RdrName -> PV (Located b) Source #

Disambiguate a variable "f" or a data constructor MkF.

mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located b) Source #

Disambiguate a monomorphic literal

mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located b) Source #

Disambiguate an overloaded literal

mkHsWildCardPV :: SrcSpan -> PV (Located b) Source #

Disambiguate a wildcard

mkHsTySigPV :: SrcSpan -> Located b -> LHsType GhcPs -> PV (Located b) Source #

Disambiguate "a :: t" (type annotation)

mkHsExplicitListPV :: SrcSpan -> [Located b] -> PV (Located b) Source #

Disambiguate "[a,b,c]" (list syntax)

mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located b) Source #

Disambiguate "$(...)" and "[quasi|...|]" (TH splices)

mkHsRecordPV :: SrcSpan -> SrcSpan -> Located b -> ([LHsRecField GhcPs (Located b)], Maybe SrcSpan) -> PV (Located b) Source #

Disambiguate "f { a = b, ... }" syntax (record construction and record updates)

mkHsNegAppPV :: SrcSpan -> Located b -> PV (Located b) Source #

Disambiguate "-a" (negation)

mkHsSectionR_PV :: SrcSpan -> Located (InfixOp b) -> Located b -> PV (Located b) Source #

Disambiguate "(# a)" (right operator section)

mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located b -> PV (Located b) Source #

Disambiguate "(a -> b)" (view pattern)

mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located b -> PV (Located b) Source #

Disambiguate "a@b" (as-pattern)

mkHsLazyPatPV :: SrcSpan -> Located b -> PV (Located b) Source #

Disambiguate "~a" (lazy pattern)

mkHsBangPatPV :: SrcSpan -> Located b -> PV (Located b) Source #

Disambiguate "!a" (bang pattern)

mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple b -> PV (Located b) Source #

Disambiguate tuple sections and unboxed sums

rejectPragmaPV :: Located b -> PV () Source #

Validate infixexp LHS to reject unwanted {--} pragmas

Instances

Instances details
DisambECP (HsCmd GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

Associated Types

type Body (HsCmd GhcPs) :: Type -> Type Source #

type InfixOp (HsCmd GhcPs) Source #

type FunArg (HsCmd GhcPs) Source #

Methods

ecpFromCmd' :: LHsCmd GhcPs -> PV (Located (HsCmd GhcPs)) Source #

ecpFromExp' :: LHsExpr GhcPs -> PV (Located (HsCmd GhcPs)) Source #

mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located (HsCmd GhcPs)) -> PV (Located (HsCmd GhcPs)) Source #

mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

superInfixOp :: (DisambInfixOp (InfixOp (HsCmd GhcPs)) => PV (Located (HsCmd GhcPs))) -> PV (Located (HsCmd GhcPs)) Source #

mkHsOpAppPV :: SrcSpan -> Located (HsCmd GhcPs) -> Located (InfixOp (HsCmd GhcPs)) -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located (HsCmd GhcPs)) -> PV (Located (HsCmd GhcPs)) Source #

mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located (HsCmd GhcPs)) -> PV (Located (HsCmd GhcPs)) Source #

superFunArg :: (DisambECP (FunArg (HsCmd GhcPs)) => PV (Located (HsCmd GhcPs))) -> PV (Located (HsCmd GhcPs)) Source #

mkHsAppPV :: SrcSpan -> Located (HsCmd GhcPs) -> Located (FunArg (HsCmd GhcPs)) -> PV (Located (HsCmd GhcPs)) Source #

mkHsAppTypePV :: SrcSpan -> Located (HsCmd GhcPs) -> LHsType GhcPs -> PV (Located (HsCmd GhcPs)) Source #

mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located (HsCmd GhcPs) -> Bool -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located (HsCmd GhcPs))] -> PV (Located (HsCmd GhcPs)) Source #

mkHsParPV :: SrcSpan -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsVarPV :: Located RdrName -> PV (Located (HsCmd GhcPs)) Source #

mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsWildCardPV :: SrcSpan -> PV (Located (HsCmd GhcPs)) Source #

mkHsTySigPV :: SrcSpan -> Located (HsCmd GhcPs) -> LHsType GhcPs -> PV (Located (HsCmd GhcPs)) Source #

mkHsExplicitListPV :: SrcSpan -> [Located (HsCmd GhcPs)] -> PV (Located (HsCmd GhcPs)) Source #

mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsRecordPV :: SrcSpan -> SrcSpan -> Located (HsCmd GhcPs) -> ([LHsRecField GhcPs (Located (HsCmd GhcPs))], Maybe SrcSpan) -> PV (Located (HsCmd GhcPs)) Source #

mkHsNegAppPV :: SrcSpan -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsSectionR_PV :: SrcSpan -> Located (InfixOp (HsCmd GhcPs)) -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsLazyPatPV :: SrcSpan -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkHsBangPatPV :: SrcSpan -> Located (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple (HsCmd GhcPs) -> PV (Located (HsCmd GhcPs)) Source #

rejectPragmaPV :: Located (HsCmd GhcPs) -> PV () Source #

DisambECP (HsExpr GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

Associated Types

type Body (HsExpr GhcPs) :: Type -> Type Source #

type InfixOp (HsExpr GhcPs) Source #

type FunArg (HsExpr GhcPs) Source #

Methods

ecpFromCmd' :: LHsCmd GhcPs -> PV (Located (HsExpr GhcPs)) Source #

ecpFromExp' :: LHsExpr GhcPs -> PV (Located (HsExpr GhcPs)) Source #

mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located (HsExpr GhcPs)) -> PV (Located (HsExpr GhcPs)) Source #

mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

superInfixOp :: (DisambInfixOp (InfixOp (HsExpr GhcPs)) => PV (Located (HsExpr GhcPs))) -> PV (Located (HsExpr GhcPs)) Source #

mkHsOpAppPV :: SrcSpan -> Located (HsExpr GhcPs) -> Located (InfixOp (HsExpr GhcPs)) -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located (HsExpr GhcPs)) -> PV (Located (HsExpr GhcPs)) Source #

mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located (HsExpr GhcPs)) -> PV (Located (HsExpr GhcPs)) Source #

superFunArg :: (DisambECP (FunArg (HsExpr GhcPs)) => PV (Located (HsExpr GhcPs))) -> PV (Located (HsExpr GhcPs)) Source #

mkHsAppPV :: SrcSpan -> Located (HsExpr GhcPs) -> Located (FunArg (HsExpr GhcPs)) -> PV (Located (HsExpr GhcPs)) Source #

mkHsAppTypePV :: SrcSpan -> Located (HsExpr GhcPs) -> LHsType GhcPs -> PV (Located (HsExpr GhcPs)) Source #

mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located (HsExpr GhcPs) -> Bool -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located (HsExpr GhcPs))] -> PV (Located (HsExpr GhcPs)) Source #

mkHsParPV :: SrcSpan -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsVarPV :: Located RdrName -> PV (Located (HsExpr GhcPs)) Source #

mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsWildCardPV :: SrcSpan -> PV (Located (HsExpr GhcPs)) Source #

mkHsTySigPV :: SrcSpan -> Located (HsExpr GhcPs) -> LHsType GhcPs -> PV (Located (HsExpr GhcPs)) Source #

mkHsExplicitListPV :: SrcSpan -> [Located (HsExpr GhcPs)] -> PV (Located (HsExpr GhcPs)) Source #

mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsRecordPV :: SrcSpan -> SrcSpan -> Located (HsExpr GhcPs) -> ([LHsRecField GhcPs (Located (HsExpr GhcPs))], Maybe SrcSpan) -> PV (Located (HsExpr GhcPs)) Source #

mkHsNegAppPV :: SrcSpan -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsSectionR_PV :: SrcSpan -> Located (InfixOp (HsExpr GhcPs)) -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsLazyPatPV :: SrcSpan -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkHsBangPatPV :: SrcSpan -> Located (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple (HsExpr GhcPs) -> PV (Located (HsExpr GhcPs)) Source #

rejectPragmaPV :: Located (HsExpr GhcPs) -> PV () Source #

DisambECP (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

Methods

ecpFromCmd' :: LHsCmd GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

ecpFromExp' :: LHsExpr GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

superInfixOp :: (DisambInfixOp (InfixOp (PatBuilder GhcPs)) => PV (Located (PatBuilder GhcPs))) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsOpAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> Located (InfixOp (PatBuilder GhcPs)) -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

superFunArg :: (DisambECP (FunArg (PatBuilder GhcPs)) => PV (Located (PatBuilder GhcPs))) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> Located (FunArg (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAppTypePV :: SrcSpan -> Located (PatBuilder GhcPs) -> LHsType GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located (PatBuilder GhcPs) -> Bool -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located (PatBuilder GhcPs))] -> PV (Located (PatBuilder GhcPs)) Source #

mkHsParPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsVarPV :: Located RdrName -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsWildCardPV :: SrcSpan -> PV (Located (PatBuilder GhcPs)) Source #

mkHsTySigPV :: SrcSpan -> Located (PatBuilder GhcPs) -> LHsType GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsExplicitListPV :: SrcSpan -> [Located (PatBuilder GhcPs)] -> PV (Located (PatBuilder GhcPs)) Source #

mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsRecordPV :: SrcSpan -> SrcSpan -> Located (PatBuilder GhcPs) -> ([LHsRecField GhcPs (Located (PatBuilder GhcPs))], Maybe SrcSpan) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsNegAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsSectionR_PV :: SrcSpan -> Located (InfixOp (PatBuilder GhcPs)) -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLazyPatPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsBangPatPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

rejectPragmaPV :: Located (PatBuilder GhcPs) -> PV () Source #

data PatBuilder p Source #

See Note [Ambiguous syntactic categories] and Note [PatBuilder]

Instances

Instances details
Outputable (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

DisambECP (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

Methods

ecpFromCmd' :: LHsCmd GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

ecpFromExp' :: LHsExpr GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

superInfixOp :: (DisambInfixOp (InfixOp (PatBuilder GhcPs)) => PV (Located (PatBuilder GhcPs))) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsOpAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> Located (InfixOp (PatBuilder GhcPs)) -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

superFunArg :: (DisambECP (FunArg (PatBuilder GhcPs)) => PV (Located (PatBuilder GhcPs))) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> Located (FunArg (PatBuilder GhcPs)) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAppTypePV :: SrcSpan -> Located (PatBuilder GhcPs) -> LHsType GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located (PatBuilder GhcPs) -> Bool -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located (PatBuilder GhcPs))] -> PV (Located (PatBuilder GhcPs)) Source #

mkHsParPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsVarPV :: Located RdrName -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsWildCardPV :: SrcSpan -> PV (Located (PatBuilder GhcPs)) Source #

mkHsTySigPV :: SrcSpan -> Located (PatBuilder GhcPs) -> LHsType GhcPs -> PV (Located (PatBuilder GhcPs)) Source #

mkHsExplicitListPV :: SrcSpan -> [Located (PatBuilder GhcPs)] -> PV (Located (PatBuilder GhcPs)) Source #

mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsRecordPV :: SrcSpan -> SrcSpan -> Located (PatBuilder GhcPs) -> ([LHsRecField GhcPs (Located (PatBuilder GhcPs))], Maybe SrcSpan) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsNegAppPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsSectionR_PV :: SrcSpan -> Located (InfixOp (PatBuilder GhcPs)) -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsLazyPatPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkHsBangPatPV :: SrcSpan -> Located (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple (PatBuilder GhcPs) -> PV (Located (PatBuilder GhcPs)) Source #

rejectPragmaPV :: Located (PatBuilder GhcPs) -> PV () Source #

type Body (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

type InfixOp (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess

type FunArg (PatBuilder GhcPs) # 
Instance details

Defined in GHC.Parser.PostProcess