- data Invariant
- checkInvariant :: Invariant -> Core -> Bool
- ensureInvariant :: Invariant -> Core -> Core
- checkInvariants :: [Invariant] -> Core -> Bool
- ensureInvariants :: [Invariant] -> Core -> Core
Documentation
Note, not all combinations are yet implemented - they crash at runtime. If you want any invariant, just email the list.
NoCoreLet | The CoreLet constructor must not occur. Removal reduces sharing |
NoCorePos | The CorePos constructor must not occur. |
CoreAppFun | All CoreFun's must be enclosed in a CoreApp. |
CoreAppCon | All CoreCon's must be enclosed in a CoreApp. |
NoEmptyApp | All CoreApp's must not have an empty argument list. |
CoreCaseVar | All CoreCase's must be on a variable. |
NoCaseDefault | All constructor CoreCase's must not contain a default. |
NoCaseDefaultOne | All constructor CoreCase defaults must represent at least two constructors. |
NoCaseConst | All CoreCase's must be on constructors, not constants. |
NoRecursiveLet | CoreLet's must not be recursive. Removal reduces sharing in limited cases |
NoCoreLam | The CoreLam constructor must not occur. |
NoPartialAppPrim | No partial applications of CoreFun to a CorePrim |
NoPartialAppCon | No partial applications of CoreCon |
ConsecutiveFuncs | Low function numbers |
UniqueVarsFunc | Unique variables in each function |
UniqueVarsCore | Unique variables in the whole program |
FuncArityAtMostOne | All CoreApp CoreFun's must have at most one argument directly present |
FuncArityExactlyOne | All CoreApp CoreFun's must have exactly one argument present |
checkInvariant :: Invariant -> Core -> BoolSource
ensureInvariant :: Invariant -> Core -> CoreSource
checkInvariants :: [Invariant] -> Core -> BoolSource
ensureInvariants :: [Invariant] -> Core -> CoreSource