| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Elara.Core.Analysis
Synopsis
- estimateArity :: CoreExpr -> Int
- declaredLambdaArity :: CoreExpr -> Int
- findTyCon :: Type -> Maybe TyCon
- guesstimateExprType :: (HasCallStack, Pretty Type, Pretty (Expr Var)) => TraceableFn "guesstimateExprType" CoreExpr Type
- overForAll :: Type -> (Type -> Type) -> Type
- varType :: Var -> Type
- literalType :: Literal -> Type
- class FreeCoreVars (ast :: Type -> Type) where
- freeCoreVars :: Ord b => ast b -> Set b
- freeCoreVarsBind :: forall (ast :: Type -> Type) a. (FreeCoreVars ast, Ord a) => Bind a ast -> Set a
- freeTypeVars :: Type -> Set TypeVariable
- splitForAlls :: Type -> ([TypeVariable], Type)
- substType :: Map TypeVariable Type -> Type -> Type
Documentation
estimateArity :: CoreExpr -> Int Source #
declaredLambdaArity :: CoreExpr -> Int Source #
guesstimateExprType :: (HasCallStack, Pretty Type, Pretty (Expr Var)) => TraceableFn "guesstimateExprType" CoreExpr Type Source #
overForAll :: Type -> (Type -> Type) -> Type Source #
Applies a function over the monotype of a potential forall expression
For example, given a type `forall a. a -> a`, overForAll would apply the function to `a -> a`
Or for forall a b c. a -> b -> c, it would apply the function to a -> b -> c
literalType :: Literal -> Type Source #
class FreeCoreVars (ast :: Type -> Type) where Source #
Methods
freeCoreVars :: Ord b => ast b -> Set b Source #
Instances
| FreeCoreVars Expr Source # | |
Defined in Elara.Core.Analysis | |
| FreeCoreVars AExpr Source # | |
Defined in Elara.Core.Analysis | |
| FreeCoreVars CExpr Source # | |
Defined in Elara.Core.Analysis | |
| FreeCoreVars Expr Source # | |
Defined in Elara.Core.Analysis | |
freeCoreVarsBind :: forall (ast :: Type -> Type) a. (FreeCoreVars ast, Ord a) => Bind a ast -> Set a Source #
freeTypeVars :: Type -> Set TypeVariable Source #
splitForAlls :: Type -> ([TypeVariable], Type) Source #
Splits a forall type into its bound type variables and the body type.
i.e. forall a b. T becomes ([a, b], T)