Safe Haskell | None |
---|
- data CoreProg
- data CoreDef = Def Id CoreExpr
- type CoreTickish = Tickish Id
- defsToRecBind :: [CoreDef] -> CoreBind
- defToIdExpr :: CoreDef -> (Id, CoreExpr)
- progToBinds :: CoreProg -> [CoreBind]
- bindsToProg :: [CoreBind] -> CoreProg
- bindToIdExprs :: CoreBind -> [(Id, CoreExpr)]
- isCoArg :: CoreExpr -> Bool
- exprTypeOrKind :: CoreExpr -> Type
- endoFunType :: Monad m => CoreExpr -> m Type
- funArgResTypes :: Monad m => CoreExpr -> m (Type, Type)
- funsWithInverseTypes :: MonadCatch m => CoreExpr -> CoreExpr -> m (Type, Type)
- appCount :: CoreExpr -> Int
- data Crumb
- = ModGuts_Prog
- | ProgCons_Head
- | ProgCons_Tail
- | NonRec_RHS
- | NonRec_Var
- | Rec_Def Int
- | Def_Id
- | Def_RHS
- | Var_Id
- | Lit_Lit
- | App_Fun
- | App_Arg
- | Lam_Var
- | Lam_Body
- | Let_Bind
- | Let_Body
- | Case_Scrutinee
- | Case_Binder
- | Case_Type
- | Case_Alt Int
- | Cast_Expr
- | Cast_Co
- | Tick_Tick
- | Tick_Expr
- | Type_Type
- | Co_Co
- | Alt_Con
- | Alt_Var Int
- | Alt_RHS
- | TyVarTy_TyVar
- | LitTy_TyLit
- | AppTy_Fun
- | AppTy_Arg
- | TyConApp_TyCon
- | TyConApp_Arg Int
- | FunTy_Dom
- | FunTy_CoDom
- | ForAllTy_Var
- | ForAllTy_Body
- | Refl_Type
- | TyConAppCo_TyCon
- | TyConAppCo_Arg Int
- | AppCo_Fun
- | AppCo_Arg
- | ForAllCo_TyVar
- | ForAllCo_Body
- | CoVarCo_CoVar
- | AxiomInstCo_Axiom
- | AxiomInstCo_Index
- | AxiomInstCo_Arg Int
- | UnsafeCo_Left
- | UnsafeCo_Right
- | SymCo_Co
- | TransCo_Left
- | TransCo_Right
- | NthCo_Int
- | NthCo_Co
- | InstCo_Co
- | InstCo_Type
- | LRCo_LR
- | LRCo_Co
- showCrumbs :: [Crumb] -> String
- deprecatedLeftSibling :: Crumb -> Maybe Crumb
- deprecatedRightSibling :: Crumb -> Maybe Crumb
Generic Data Type
A program is a telescope of nested binding groups.
That is, each binding scopes over the remainder of the program.
In GHC Core, programs are encoded as [CoreBind
].
This data type is isomorphic.
type CoreTickish = Tickish IdSource
Conversions to/from Core
defsToRecBind :: [CoreDef] -> CoreBindSource
Convert a list of recursive definitions into an (isomorphic) recursive binding group.
defToIdExpr :: CoreDef -> (Id, CoreExpr)Source
Convert a definition to an identifier/expression pair.
progToBinds :: CoreProg -> [CoreBind]Source
Get the list of bindings in a program.
bindsToProg :: [CoreBind] -> CoreProgSource
Build a program from a list of bindings. Note that bindings earlier in the list are considered scope over bindings later in the list.
bindToIdExprs :: CoreBind -> [(Id, CoreExpr)]Source
Extract the list of identifier/expression pairs from a binding group.
Utilities
isCoArg :: CoreExpr -> BoolSource
Returns True
iff the expression is a Coercion
expression at its top level.
exprTypeOrKind :: CoreExpr -> TypeSource
endoFunType :: Monad m => CoreExpr -> m TypeSource
Return the domain/codomain type of an endofunction expression.
funArgResTypes :: Monad m => CoreExpr -> m (Type, Type)Source
Return the domain and codomain types of a function expression.
funsWithInverseTypes :: MonadCatch m => CoreExpr -> CoreExpr -> m (Type, Type)Source
Check two expressions have types a -> b
and b -> a
, returning (a,b)
.
Crumbs
Crumbs record a path through the tree, using descriptive constructor names.
Eq Crumb | |
Read Crumb | |
Show Crumb | |
Extern Crumb | |
Extern PathH | |
ExtendPath HermitC Crumb | Extend the |
ExtendPath PrettyC Crumb | |
ReadPath HermitC Crumb | Retrieve the |
ReadPath PrettyC Crumb | |
Extern (TranslateH Core PathH) |
showCrumbs :: [Crumb] -> StringSource