ghc-7.6.3: The GHC API

Safe Haskell | None

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 :: [Maybe (Tickish Id)] -> 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

mkOptTickBox :: Maybe (Tickish Id) -> CoreExpr -> CoreExpr

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