Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs
- mkHsIntegral :: IntegralLit -> HsOverLit GhcPs
- mkHsFractional :: FractionalLit -> HsOverLit GhcPs
- mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs
- mkHsDo :: HsStmtContext GhcRn -> [ExprLStmt GhcPs] -> HsExpr GhcPs
- mkSpliceDecl :: LHsExpr GhcPs -> HsDecl GhcPs
- mkRoleAnnotDecl :: SrcSpan -> Located RdrName -> [Located (Maybe FastString)] -> P (LRoleAnnotDecl GhcPs)
- mkClassDecl :: SrcSpan -> Located (Maybe (LHsContext GhcPs), LHsType GhcPs) -> Located (a, [LHsFunDep GhcPs]) -> OrdList (LHsDecl GhcPs) -> LayoutInfo -> P (LTyClDecl GhcPs)
- mkTyData :: SrcSpan -> NewOrData -> Maybe (Located CType) -> Located (Maybe (LHsContext GhcPs), LHsType GhcPs) -> Maybe (LHsKind GhcPs) -> [LConDecl GhcPs] -> HsDeriving GhcPs -> P (LTyClDecl GhcPs)
- mkDataFamInst :: SrcSpan -> NewOrData -> Maybe (Located CType) -> (Maybe (LHsContext GhcPs), Maybe [LHsTyVarBndr () GhcPs], LHsType GhcPs) -> Maybe (LHsKind GhcPs) -> [LConDecl GhcPs] -> HsDeriving GhcPs -> P (LInstDecl GhcPs)
- mkTySynonym :: SrcSpan -> LHsType GhcPs -> LHsType GhcPs -> P (LTyClDecl GhcPs)
- mkTyFamInstEqn :: Maybe [LHsTyVarBndr () GhcPs] -> LHsType GhcPs -> LHsType GhcPs -> P (TyFamInstEqn GhcPs, [AddAnn])
- mkStandaloneKindSig :: SrcSpan -> Located [Located RdrName] -> LHsKind GhcPs -> P (LStandaloneKindSig GhcPs)
- mkTyFamInst :: SrcSpan -> TyFamInstEqn GhcPs -> P (LInstDecl GhcPs)
- mkFamDecl :: SrcSpan -> FamilyInfo GhcPs -> LHsType GhcPs -> Located (FamilyResultSig GhcPs) -> Maybe (LInjectivityAnn GhcPs) -> P (LTyClDecl GhcPs)
- mkLHsSigType :: LHsType GhcPs -> LHsSigType GhcPs
- mkInlinePragma :: SourceText -> (InlineSpec, RuleMatchInfo) -> Maybe Activation -> InlinePragma
- mkPatSynMatchGroup :: Located RdrName -> Located (OrdList (LHsDecl GhcPs)) -> P (MatchGroup GhcPs (LHsExpr GhcPs))
- mkRecConstrOrUpdate :: LHsExpr GhcPs -> SrcSpan -> ([LHsRecField GhcPs (LHsExpr GhcPs)], Maybe SrcSpan) -> PV (HsExpr GhcPs)
- mkTyClD :: LTyClDecl (GhcPass p) -> LHsDecl (GhcPass p)
- mkInstD :: LInstDecl (GhcPass p) -> LHsDecl (GhcPass p)
- mkRdrRecordCon :: Located RdrName -> HsRecordBinds GhcPs -> HsExpr GhcPs
- mkRdrRecordUpd :: LHsExpr GhcPs -> [LHsRecUpdField GhcPs] -> HsExpr GhcPs
- setRdrNameSpace :: RdrName -> NameSpace -> RdrName
- filterCTuple :: RdrName -> RdrName
- fromSpecTyVarBndr :: LHsTyVarBndr Specificity GhcPs -> P (LHsTyVarBndr () GhcPs)
- fromSpecTyVarBndrs :: [LHsTyVarBndr Specificity GhcPs] -> P [LHsTyVarBndr () GhcPs]
- cvBindGroup :: OrdList (LHsDecl GhcPs) -> P (HsValBinds GhcPs)
- cvBindsAndSigs :: OrdList (LHsDecl GhcPs) -> P (LHsBinds GhcPs, [LSig GhcPs], [LFamilyDecl GhcPs], [LTyFamInstDecl GhcPs], [LDataFamInstDecl GhcPs], [LDocDecl])
- cvTopDecls :: OrdList (LHsDecl GhcPs) -> [LHsDecl GhcPs]
- placeHolderPunRhs :: DisambECP b => PV (Located b)
- mkImport :: Located CCallConv -> Located Safety -> (Located StringLiteral, Located RdrName, LHsSigType GhcPs) -> P (HsDecl GhcPs)
- parseCImport :: Located CCallConv -> Located Safety -> FastString -> String -> Located SourceText -> Maybe ForeignImport
- mkExport :: Located CCallConv -> (Located StringLiteral, Located RdrName, LHsSigType GhcPs) -> P (HsDecl GhcPs)
- mkExtName :: RdrName -> CLabelString
- mkGadtDecl :: [Located RdrName] -> LHsType GhcPs -> P (ConDecl GhcPs)
- mkConDeclH98 :: Located RdrName -> Maybe [LHsTyVarBndr Specificity GhcPs] -> Maybe (LHsContext GhcPs) -> HsConDeclDetails GhcPs -> ConDecl GhcPs
- checkImportDecl :: Maybe (Located Token) -> Maybe (Located Token) -> P ()
- checkExpBlockArguments :: LHsExpr GhcPs -> PV ()
- checkCmdBlockArguments :: LHsCmd GhcPs -> PV ()
- checkPrecP :: Located (SourceText, Int) -> Located (OrdList (Located RdrName)) -> P ()
- checkContext :: LHsType GhcPs -> P ([AddAnn], LHsContext GhcPs)
- checkPattern :: Located (PatBuilder GhcPs) -> P (LPat GhcPs)
- checkPattern_msg :: SDoc -> PV (Located (PatBuilder GhcPs)) -> P (LPat GhcPs)
- checkMonadComp :: PV (HsStmtContext GhcRn)
- checkValDef :: Located (PatBuilder GhcPs) -> Maybe (LHsType GhcPs) -> Located (a, GRHSs GhcPs (LHsExpr GhcPs)) -> P ([AddAnn], HsBind GhcPs)
- checkValSigLhs :: LHsExpr GhcPs -> P (Located RdrName)
- type LRuleTyTmVar = Located RuleTyTmVar
- data RuleTyTmVar = RuleTyTmVar (Located RdrName) (Maybe (LHsType GhcPs))
- mkRuleBndrs :: [LRuleTyTmVar] -> [LRuleBndr GhcPs]
- mkRuleTyVarBndrs :: [LRuleTyTmVar] -> [LHsTyVarBndr () GhcPs]
- checkRuleTyVarBndrNames :: [LHsTyVarBndr flag GhcPs] -> P ()
- checkRecordSyntax :: (MonadP m, Outputable a) => Located a -> m (Located a)
- checkEmptyGADTs :: Located ([AddAnn], [LConDecl GhcPs]) -> P (Located ([AddAnn], [LConDecl GhcPs]))
- addFatalError :: MonadP m => SrcSpan -> SDoc -> m a
- hintBangPat :: SrcSpan -> Pat GhcPs -> PV ()
- data TyEl
- mergeOps :: [Located TyEl] -> P (LHsType GhcPs)
- mergeDataCon :: [Located TyEl] -> P (Located RdrName, HsConDeclDetails GhcPs)
- mkBangTy :: SrcStrictness -> LHsType GhcPs -> HsType GhcPs
- data ImpExpSubSpec
- data ImpExpQcSpec
- mkModuleImpExp :: Located ImpExpQcSpec -> ImpExpSubSpec -> P (IE GhcPs)
- mkTypeImpExp :: Located RdrName -> P (Located RdrName)
- mkImpExpSubSpec :: [Located ImpExpQcSpec] -> P ([AddAnn], ImpExpSubSpec)
- checkImportSpec :: Located [LIE GhcPs] -> P (Located [LIE GhcPs])
- forallSym :: Bool -> String
- starSym :: Bool -> String
- warnStarIsType :: SrcSpan -> P ()
- warnPrepositiveQualifiedModule :: SrcSpan -> P ()
- failOpFewArgs :: Located RdrName -> P a
- failOpNotEnabledImportQualifiedPost :: SrcSpan -> P ()
- failOpImportQualifiedTwice :: SrcSpan -> P ()
- data SumOrTuple b
- data PV a
- runPV :: PV a -> P a
- newtype ECP = ECP {}
- runECP_P :: DisambECP b => ECP -> P (Located b)
- class DisambInfixOp b where
- mkHsVarOpPV :: Located RdrName -> PV (Located b)
- mkHsConOpPV :: Located RdrName -> PV (Located b)
- mkHsInfixHolePV :: SrcSpan -> PV (Located b)
- class b ~ Body b GhcPs => DisambECP b where
- type Body b :: Type -> Type
- type InfixOp b
- type FunArg b
- ecpFromCmd' :: LHsCmd GhcPs -> PV (Located b)
- ecpFromExp' :: LHsExpr GhcPs -> PV (Located b)
- mkHsLamPV :: SrcSpan -> MatchGroup GhcPs (Located b) -> PV (Located b)
- mkHsLetPV :: SrcSpan -> LHsLocalBinds GhcPs -> Located b -> PV (Located b)
- superInfixOp :: (DisambInfixOp (InfixOp b) => PV (Located b)) -> PV (Located b)
- mkHsOpAppPV :: SrcSpan -> Located b -> Located (InfixOp b) -> Located b -> PV (Located b)
- mkHsCasePV :: SrcSpan -> LHsExpr GhcPs -> MatchGroup GhcPs (Located b) -> PV (Located b)
- mkHsLamCasePV :: SrcSpan -> MatchGroup GhcPs (Located b) -> PV (Located b)
- superFunArg :: (DisambECP (FunArg b) => PV (Located b)) -> PV (Located b)
- mkHsAppPV :: SrcSpan -> Located b -> Located (FunArg b) -> PV (Located b)
- mkHsAppTypePV :: SrcSpan -> Located b -> LHsType GhcPs -> PV (Located b)
- mkHsIfPV :: SrcSpan -> LHsExpr GhcPs -> Bool -> Located b -> Bool -> Located b -> PV (Located b)
- mkHsDoPV :: SrcSpan -> Maybe ModuleName -> Located [LStmt GhcPs (Located b)] -> PV (Located b)
- mkHsParPV :: SrcSpan -> Located b -> PV (Located b)
- mkHsVarPV :: Located RdrName -> PV (Located b)
- mkHsLitPV :: Located (HsLit GhcPs) -> PV (Located b)
- mkHsOverLitPV :: Located (HsOverLit GhcPs) -> PV (Located b)
- mkHsWildCardPV :: SrcSpan -> PV (Located b)
- mkHsTySigPV :: SrcSpan -> Located b -> LHsType GhcPs -> PV (Located b)
- mkHsExplicitListPV :: SrcSpan -> [Located b] -> PV (Located b)
- mkHsSplicePV :: Located (HsSplice GhcPs) -> PV (Located b)
- mkHsRecordPV :: SrcSpan -> SrcSpan -> Located b -> ([LHsRecField GhcPs (Located b)], Maybe SrcSpan) -> PV (Located b)
- mkHsNegAppPV :: SrcSpan -> Located b -> PV (Located b)
- mkHsSectionR_PV :: SrcSpan -> Located (InfixOp b) -> Located b -> PV (Located b)
- mkHsViewPatPV :: SrcSpan -> LHsExpr GhcPs -> Located b -> PV (Located b)
- mkHsAsPatPV :: SrcSpan -> Located RdrName -> Located b -> PV (Located b)
- mkHsLazyPatPV :: SrcSpan -> Located b -> PV (Located b)
- mkHsBangPatPV :: SrcSpan -> Located b -> PV (Located b)
- mkSumOrTuplePV :: SrcSpan -> Boxity -> SumOrTuple b -> PV (Located b)
- rejectPragmaPV :: Located b -> PV ()
- ecpFromExp :: LHsExpr GhcPs -> ECP
- ecpFromCmd :: LHsCmd GhcPs -> ECP
- data PatBuilder p
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.
mkHsIntegral :: IntegralLit -> HsOverLit GhcPs Source #
mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs Source #
mkRoleAnnotDecl :: SrcSpan -> Located RdrName -> [Located (Maybe FastString)] -> P (LRoleAnnotDecl GhcPs) Source #
mkClassDecl :: SrcSpan -> Located (Maybe (LHsContext GhcPs), LHsType GhcPs) -> Located (a, [LHsFunDep GhcPs]) -> OrdList (LHsDecl GhcPs) -> LayoutInfo -> P (LTyClDecl GhcPs) Source #
mkTyData :: SrcSpan -> NewOrData -> Maybe (Located CType) -> Located (Maybe (LHsContext GhcPs), LHsType GhcPs) -> Maybe (LHsKind GhcPs) -> [LConDecl GhcPs] -> HsDeriving GhcPs -> P (LTyClDecl GhcPs) Source #
mkDataFamInst :: SrcSpan -> NewOrData -> Maybe (Located CType) -> (Maybe (LHsContext GhcPs), Maybe [LHsTyVarBndr () GhcPs], LHsType GhcPs) -> Maybe (LHsKind GhcPs) -> [LConDecl GhcPs] -> HsDeriving GhcPs -> P (LInstDecl GhcPs) Source #
mkTyFamInstEqn :: Maybe [LHsTyVarBndr () GhcPs] -> LHsType GhcPs -> LHsType GhcPs -> P (TyFamInstEqn GhcPs, [AddAnn]) Source #
mkStandaloneKindSig :: SrcSpan -> Located [Located RdrName] -> LHsKind GhcPs -> P (LStandaloneKindSig GhcPs) Source #
mkTyFamInst :: SrcSpan -> TyFamInstEqn GhcPs -> P (LInstDecl GhcPs) Source #
mkFamDecl :: SrcSpan -> FamilyInfo GhcPs -> LHsType GhcPs -> Located (FamilyResultSig GhcPs) -> Maybe (LInjectivityAnn GhcPs) -> P (LTyClDecl GhcPs) Source #
mkLHsSigType :: LHsType GhcPs -> LHsSigType GhcPs Source #
mkInlinePragma :: SourceText -> (InlineSpec, RuleMatchInfo) -> Maybe Activation -> InlinePragma Source #
mkPatSynMatchGroup :: Located RdrName -> Located (OrdList (LHsDecl GhcPs)) -> P (MatchGroup GhcPs (LHsExpr GhcPs)) Source #
mkRecConstrOrUpdate :: LHsExpr GhcPs -> SrcSpan -> ([LHsRecField GhcPs (LHsExpr GhcPs)], Maybe SrcSpan) -> PV (HsExpr GhcPs) Source #
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).
mkRdrRecordCon :: Located RdrName -> HsRecordBinds GhcPs -> HsExpr GhcPs Source #
mkRdrRecordUpd :: LHsExpr GhcPs -> [LHsRecUpdField GhcPs] -> HsExpr GhcPs Source #
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 LHsTyVarBndr
s annotated with their Specificity
to
binders without annotations. Only accepts specified variables, and errors if
any of the provided binders has an InferredSpec
annotation.
cvBindGroup :: OrdList (LHsDecl GhcPs) -> P (HsValBinds GhcPs) Source #
cvBindsAndSigs :: OrdList (LHsDecl GhcPs) -> P (LHsBinds GhcPs, [LSig GhcPs], [LFamilyDecl GhcPs], [LTyFamInstDecl GhcPs], [LDataFamInstDecl GhcPs], [LDocDecl]) Source #
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.
mkImport :: Located CCallConv -> Located Safety -> (Located StringLiteral, Located RdrName, LHsSigType GhcPs) -> P (HsDecl GhcPs) Source #
parseCImport :: Located CCallConv -> Located Safety -> FastString -> String -> Located SourceText -> Maybe ForeignImport Source #
mkExport :: Located CCallConv -> (Located StringLiteral, Located RdrName, LHsSigType GhcPs) -> P (HsDecl GhcPs) Source #
mkExtName :: RdrName -> CLabelString Source #
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.
mkConDeclH98 :: Located RdrName -> Maybe [LHsTyVarBndr Specificity GhcPs] -> Maybe (LHsContext GhcPs) -> HsConDeclDetails GhcPs -> ConDecl GhcPs Source #
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.
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]
checkPattern :: Located (PatBuilder GhcPs) -> P (LPat GhcPs) Source #
checkValDef :: Located (PatBuilder GhcPs) -> Maybe (LHsType GhcPs) -> Located (a, GRHSs GhcPs (LHsExpr GhcPs)) -> P ([AddAnn], HsBind GhcPs) Source #
type LRuleTyTmVar = Located RuleTyTmVar Source #
data RuleTyTmVar Source #
Essentially a wrapper for a RuleBndr GhcPs
mkRuleBndrs :: [LRuleTyTmVar] -> [LRuleBndr GhcPs] Source #
mkRuleTyVarBndrs :: [LRuleTyTmVar] -> [LHsTyVarBndr () GhcPs] Source #
checkRuleTyVarBndrNames :: [LHsTyVarBndr flag GhcPs] -> P () Source #
checkRecordSyntax :: (MonadP m, Outputable a) => Located a -> m (Located a) Source #
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.
Either an operator or an operand.
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 ImpExpSubSpec Source #
data ImpExpQcSpec Source #
mkModuleImpExp :: Located ImpExpQcSpec -> ImpExpSubSpec -> P (IE GhcPs) Source #
mkImpExpSubSpec :: [Located ImpExpQcSpec] -> P ([AddAnn], ImpExpSubSpec) Source #
warnStarIsType :: SrcSpan -> P () Source #
warnPrepositiveQualifiedModule :: SrcSpan -> P () Source #
failOpNotEnabledImportQualifiedPost :: SrcSpan -> P () Source #
failOpImportQualifiedTwice :: SrcSpan -> P () Source #
class DisambInfixOp b where Source #
Disambiguate infix operators. See Note [Ambiguous syntactic categories]
mkHsVarOpPV :: Located RdrName -> PV (Located b) Source #
Instances
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]
type Body b :: Type -> Type Source #
See Note [Body in DisambECP]
Infix operator representation
Function argument representation
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 #
Instances
data PatBuilder p Source #
See Note [Ambiguous syntactic categories] and Note [PatBuilder]