DsUtils

ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

DsUtils

Description

Utility functions for constructing Core syntax, principally for desugaring

# Documentation

data EquationInfo

Constructors

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

Instances

Outputable EquationInfo |

firstPat :: EquationInfo -> Pat Id

shiftEqns :: [EquationInfo] -> [EquationInfo]

data MatchResult

Constructors

MatchResult CanItFail (CoreExpr -> DsM CoreExpr) |

data CanItFail

Constructors

CanFail |
CantFail |

data CaseAlt a

Constructors

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

cantFailMatchResult :: CoreExpr -> MatchResult

alwaysFailMatchResult :: MatchResult

extractMatchResult :: MatchResult -> CoreExpr -> DsM CoreExpr

combineMatchResults :: MatchResult -> MatchResult -> MatchResult

adjustMatchResult :: DsWrapper -> MatchResult -> MatchResult

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

mkCoLetMatchResult :: CoreBind -> MatchResult -> MatchResult

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

mkGuardedMatchResult :: CoreExpr -> MatchResult -> MatchResult

matchCanFail :: MatchResult -> Bool

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

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

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

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

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

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

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

mkCoreAppDs :: CoreExpr -> CoreExpr -> CoreExpr

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

seqVar :: Var -> CoreExpr -> CoreExpr

mkLHsVarPatTup :: [Id] -> LPat Id

mkLHsPatTup :: [LPat Id] -> LPat Id

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

mkBigLHsVarTup :: [Id] -> LHsExpr Id

mkBigLHsTup :: [LHsExpr Id] -> LHsExpr Id

mkBigLHsVarPatTup :: [Id] -> LPat Id

mkBigLHsPatTup :: [LPat Id] -> LPat Id

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

selectSimpleMatchVarL :: LPat Id -> DsM Id

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

selectMatchVar :: Pat Id -> DsM Id

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

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