- type CoreVarName = String
- type CoreFuncName = String
- type CoreDataName = String
- type CoreCtorName = String
- type CoreFieldName = String
- data Core = Core {}
- data CoreData = CoreData {
- coreDataName :: CoreDataName
- coreDataTypes :: [String]
- coreDataCtors :: [CoreCtor]
- data CoreCtor = CoreCtor {}
- data CoreFunc
- isCorePrim :: CoreFunc -> Bool
- isCoreFunc :: CoreFunc -> Bool
- coreFuncArity :: CoreFunc -> Int
- coreFuncArgList :: CoreFunc -> [CoreVarName]
- type CoreFuncMap = Map CoreFuncName CoreFunc
- data CoreExpr
- = CoreCon CoreCtorName
- | CoreVar CoreVarName
- | CoreFun CoreFuncName
- | CoreApp CoreExpr [CoreExpr]
- | CoreLam [CoreVarName] CoreExpr
- | CoreCase CoreExpr [(CorePat, CoreExpr)]
- | CoreLet [(CoreVarName, CoreExpr)] CoreExpr
- | CorePos String CoreExpr
- | CoreLit CoreLit
- data CoreLit
- data CorePat
- = PatCon {
- patCon :: CoreCtorName
- patVars :: [CoreVarName]
- | PatLit { }
- | PatDefault
- = PatCon {
- coreApp :: CoreExpr -> [CoreExpr] -> CoreExpr
- coreLet :: [(CoreVarName, CoreExpr)] -> CoreExpr -> CoreExpr
- coreLam :: [CoreVarName] -> CoreExpr -> CoreExpr
- fromCoreLit :: CoreExpr -> CoreLit
- fromCoreVar :: CoreExpr -> String
- fromCoreFun :: CoreExpr -> String
- fromCoreCon :: CoreExpr -> String
- fromCoreApp :: CoreExpr -> (CoreExpr, [CoreExpr])
- fromCoreLet :: CoreExpr -> ([(CoreVarName, CoreExpr)], CoreExpr)
- fromCoreLam :: CoreExpr -> ([CoreVarName], CoreExpr)
- isCoreVar :: CoreExpr -> Bool
- isCoreFun :: CoreExpr -> Bool
- isCoreLam :: CoreExpr -> Bool
- isCoreCon :: CoreExpr -> Bool
- isCoreLet :: CoreExpr -> Bool
- isCoreCase :: CoreExpr -> Bool
- isCoreLit :: CoreExpr -> Bool
- isCorePos :: CoreExpr -> Bool
- isCoreChr :: CoreLit -> Bool
- isCoreInt :: CoreLit -> Bool
- isCoreStr :: CoreLit -> Bool
- isPatLit :: CorePat -> Bool
- isPatCon :: CorePat -> Bool
- isPatDefault :: CorePat -> Bool
- patToExpr :: CorePat -> CoreExpr
- exprToPat :: CoreExpr -> CorePat
- isCoreLitSmall :: CoreLit -> Bool
- remCorePos :: CoreExpr -> CoreExpr
- dropModule :: String -> String
- coreFunc :: Core -> CoreFuncName -> CoreFunc
- coreFuncMaybe :: Core -> CoreFuncName -> Maybe CoreFunc
- coreFieldDataMaybe :: Core -> CoreFieldName -> Maybe CoreData
- coreCtorDataMaybe :: Core -> CoreCtorName -> Maybe CoreData
- coreFieldCtorMaybe :: Core -> CoreFieldName -> Maybe CoreCtor
- coreFieldData :: Core -> CoreFieldName -> CoreData
- coreCtorData :: Core -> CoreCtorName -> CoreData
- coreFieldCtor :: Core -> CoreFieldName -> CoreCtor
- coreCtor :: Core -> CoreCtorName -> CoreCtor
- coreData :: Core -> CoreDataName -> CoreData
- applyBodyCore :: (CoreExpr -> CoreExpr) -> Core -> Core
- applyBodyFunc :: (CoreExpr -> CoreExpr) -> CoreFunc -> CoreFunc
- applyFuncCore :: (CoreFunc -> CoreFunc) -> Core -> Core
- applyCtorCore :: (CoreCtor -> CoreCtor) -> Core -> Core
- applyDataCore :: (CoreData -> CoreData) -> Core -> Core
- applyCtorData :: (CoreCtor -> CoreCtor) -> CoreData -> CoreData
- applyBodyCoreM :: Monad m => (CoreExpr -> m CoreExpr) -> Core -> m Core
- applyFuncCoreM :: Monad m => (CoreFunc -> m CoreFunc) -> Core -> m Core
- coreDataTypeSplit :: String -> [String]
- coreDataTypeJoin :: [String] -> String
- fromCoreFuncMap :: Core -> CoreFuncMap -> Core
- toCoreFuncMap :: Core -> CoreFuncMap
- coreFuncMap :: CoreFuncMap -> CoreFuncName -> CoreFunc
- coreFuncMapMaybe :: CoreFuncMap -> CoreFuncName -> Maybe CoreFunc
Documentation
type CoreVarName = StringSource
type CoreFuncName = StringSource
type CoreDataName = StringSource
type CoreCtorName = StringSource
type CoreFieldName = StringSource
CoreData | |
|
isCorePrim :: CoreFunc -> BoolSource
isCoreFunc :: CoreFunc -> BoolSource
coreFuncArity :: CoreFunc -> IntSource
coreFuncArgList :: CoreFunc -> [CoreVarName]Source
type CoreFuncMap = Map CoreFuncName CoreFuncSource
coreLam :: [CoreVarName] -> CoreExpr -> CoreExprSource
fromCoreLit :: CoreExpr -> CoreLitSource
fromCoreVar :: CoreExpr -> StringSource
fromCoreFun :: CoreExpr -> StringSource
fromCoreCon :: CoreExpr -> StringSource
fromCoreApp :: CoreExpr -> (CoreExpr, [CoreExpr])Source
fromCoreLet :: CoreExpr -> ([(CoreVarName, CoreExpr)], CoreExpr)Source
fromCoreLam :: CoreExpr -> ([CoreVarName], CoreExpr)Source
isCoreCase :: CoreExpr -> BoolSource
isPatDefault :: CorePat -> BoolSource
isCoreLitSmall :: CoreLit -> BoolSource
Returns true for constants that take a small, bounded amount of space
remCorePos :: CoreExpr -> CoreExprSource
dropModule :: String -> StringSource
drop a module from a Core declaration
coreFunc :: Core -> CoreFuncName -> CoreFuncSource
Get a function from a Core type crashes if the function does not exist
coreFuncMaybe :: Core -> CoreFuncName -> Maybe CoreFuncSource
A non-crashing version of coreFunc
returns Nothing if the function does not exist.
If multiple functions with the same name exist, this crashes.
coreFieldDataMaybe :: Core -> CoreFieldName -> Maybe CoreDataSource
Get a CoreData
from a field (the snd element of coreCtorFields
)
coreCtorDataMaybe :: Core -> CoreCtorName -> Maybe CoreDataSource
Get a CoreData
from a ctor name
coreFieldCtorMaybe :: Core -> CoreFieldName -> Maybe CoreCtorSource
Get a CoreCtor
from a field name
coreFieldData :: Core -> CoreFieldName -> CoreDataSource
coreCtorData :: Core -> CoreCtorName -> CoreDataSource
coreFieldCtor :: Core -> CoreFieldName -> CoreCtorSource
coreCtor :: Core -> CoreCtorName -> CoreCtorSource
coreData :: Core -> CoreDataName -> CoreDataSource
applyBodyCore :: (CoreExpr -> CoreExpr) -> Core -> CoreSource
Take a function that operates on bodies, and apply it to a program
applyBodyFunc :: (CoreExpr -> CoreExpr) -> CoreFunc -> CoreFuncSource
Take a function that operates on bodies, and apply it to a function
applyFuncCore :: (CoreFunc -> CoreFunc) -> Core -> CoreSource
Take a function that operates on functions, and apply it to a program
coreDataTypeSplit :: String -> [String]Source
coreDataTypeJoin :: [String] -> StringSource
can pretty print much nicer, just something that works for now
fromCoreFuncMap :: Core -> CoreFuncMap -> CoreSource
coreFuncMap :: CoreFuncMap -> CoreFuncName -> CoreFuncSource