DsUtils

ghc-7.0.4: The GHC API

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 |

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 :: Id -> Type -> [(DataCon, [CoreBndr], MatchResult)] -> 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 :: LPat Id -> CoreExpr -> DsM [(Id, CoreExpr)]

dsSyntaxTable :: SyntaxTable Id -> DsM ([CoreBind], [(Name, Id)])

lookupEvidence :: [(Name, Id)] -> Name -> Id

selectSimpleMatchVarL :: LPat Id -> DsM Id

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

selectMatchVar :: Pat Id -> DsM Id

mkTickBox :: Int -> [Id] -> CoreExpr -> DsM CoreExpr

mkOptTickBox :: Maybe (Int, [Id]) -> CoreExpr -> DsM CoreExpr

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