ghc-7.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

DsUtils

Description

Utility functions for constructing Core syntax, principally for desugaring

# Documentation

data EquationInfo Source

Constructors

EqnInfo |
Fields eqn_pats :: [Pat Id] eqn_rhs :: MatchResult

Instances

Outputable EquationInfo |

firstPat :: EquationInfo -> Pat Id Source

shiftEqns :: [EquationInfo] -> [EquationInfo] Source

data MatchResult Source

Constructors

MatchResult CanItFail (CoreExpr -> DsM CoreExpr) |

data CanItFail Source

Constructors

CanFail |
CantFail |

data CaseAlt a Source

Constructors

MkCaseAlt |
Fields alt_pat :: a alt_bndrs :: [CoreBndr] alt_wrapper :: HsWrapper alt_result :: MatchResult

cantFailMatchResult :: CoreExpr -> MatchResult Source

alwaysFailMatchResult :: MatchResult Source

extractMatchResult :: MatchResult -> CoreExpr -> DsM CoreExpr Source

combineMatchResults :: MatchResult -> MatchResult -> MatchResult Source

adjustMatchResult :: DsWrapper -> MatchResult -> MatchResult Source

adjustMatchResultDs :: (CoreExpr -> DsM CoreExpr) -> MatchResult -> MatchResult Source

mkCoLetMatchResult :: CoreBind -> MatchResult -> MatchResult Source

mkViewMatchResult :: Id -> CoreExpr -> Id -> MatchResult -> MatchResult Source

mkGuardedMatchResult :: CoreExpr -> MatchResult -> MatchResult Source

matchCanFail :: MatchResult -> Bool Source

mkEvalMatchResult :: Id -> Type -> MatchResult -> MatchResult Source

mkCoPrimCaseMatchResult :: Id -> Type -> [(Literal, MatchResult)] -> MatchResult Source

mkCoAlgCaseMatchResult :: DynFlags -> Id -> Type -> [CaseAlt DataCon] -> MatchResult Source

mkCoSynCaseMatchResult :: Id -> Type -> CaseAlt PatSyn -> MatchResult Source

wrapBind :: Var -> Var -> CoreExpr -> CoreExpr Source

wrapBinds :: [(Var, Var)] -> CoreExpr -> CoreExpr Source

mkErrorAppDs :: Id -> Type -> SDoc -> DsM CoreExpr Source

mkCoreAppDs :: CoreExpr -> CoreExpr -> CoreExpr Source

mkCoreAppsDs :: CoreExpr -> [CoreExpr] -> CoreExpr Source

seqVar :: Var -> CoreExpr -> CoreExpr Source

mkLHsVarPatTup :: [Id] -> LPat Id Source

mkLHsPatTup :: [LPat Id] -> LPat Id Source

mkVanillaTuplePat :: [OutPat Id] -> Boxity -> Pat Id Source

mkBigLHsVarTup :: [Id] -> LHsExpr Id Source

mkBigLHsTup :: [LHsExpr Id] -> LHsExpr Id Source

mkBigLHsVarPatTup :: [Id] -> LPat Id Source

mkBigLHsPatTup :: [LPat Id] -> LPat Id Source

mkSelectorBinds :: [[Tickish Id]] -> LPat Id -> CoreExpr -> DsM [(Id, CoreExpr)] Source

selectSimpleMatchVarL :: LPat Id -> DsM Id Source

selectMatchVars :: [Pat Id] -> DsM [Id] Source

selectMatchVar :: Pat Id -> DsM Id Source

mkOptTickBox :: [Tickish Id] -> CoreExpr -> CoreExpr Source

mkBinaryTickBox :: Int -> Int -> CoreExpr -> DsM CoreExpr Source