Stability | experimental |
---|---|
Maintainer | developer@flocc.net |
Safe Haskell | None |
For more information please see http://www.flocc.net/
- assignTypes :: Monad a => TyEnv -> Expr -> StateT IdxSet a TyEnv
- assignNewTypes :: Monad a => TyEnv -> TyEnv -> Expr -> StateT IdxSet a TyEnv
- typeOfVal :: Val -> TyTerm
- intTy :: Term l (FunctionToken TyToken)
- data ExpLbl
- type FuncTerm t = Term ExpLbl (FunctionToken t)
- type FuncEnv t = TermEnv ExpLbl (FunctionToken t)
- type FuncConstr t = Constr (FuncTerm t)
- type FuncScheme t = Scheme ExpLbl (FunctionToken t)
- data TyToken = Ty String
- type TyTerm = FuncTerm TyToken
- type TyConstr = FuncConstr TyToken
- type TyEnv = FuncEnv TyToken
- type TyScheme = FuncScheme TyToken
- type TySchemeEx = SchemeEx ExpLbl (FunctionToken TyToken)
- showExprWithTypes :: TyEnv -> Expr -> String
- showGlobalTypeTerms :: String
- showTyScheme :: TyScheme -> String
- rel :: TyTerm -> TyTerm -> TyTerm
- relNonOrd :: Term l (FunctionToken TyToken)
- getTupleAccessorFun :: Int -> Int -> (String, Idx)
- typeSchemesToTerms :: Map Idx TyScheme -> Map Idx TyTerm
- stripConstrLabels :: TyConstr -> TyConstr
- nullTy :: Term l (FunctionToken TyToken)
- boolTy :: Term l (FunctionToken TyToken)
- floatTy :: Term l (FunctionToken TyToken)
- typeName :: TyTerm -> Maybe String
- findDefaultSubsts :: TyEnv -> Substs TyTerm
Documentation
assignTypes :: Monad a => TyEnv -> Expr -> StateT IdxSet a TyEnv
Takes an initial (global) type environment, and an expression |and returns a type environment mapping all expression ids to |type terms.
assignNewTypes :: Monad a => TyEnv -> TyEnv -> Expr -> StateT IdxSet a TyEnv
assignNewTypes takes the global type environment, a type environment giving type |assignments for some of the sub expressions, and an expression and returns |a type environment mapping expression ids to type schemes.
intTy :: Term l (FunctionToken TyToken)
type FuncTerm t = Term ExpLbl (FunctionToken t)
type FuncEnv t = TermEnv ExpLbl (FunctionToken t)
type FuncConstr t = Constr (FuncTerm t)
type FuncScheme t = Scheme ExpLbl (FunctionToken t)
data TyToken
Token type for type term language
type TyConstr = FuncConstr TyToken
type TyScheme = FuncScheme TyToken
type TySchemeEx = SchemeEx ExpLbl (FunctionToken TyToken)
showExprWithTypes :: TyEnv -> Expr -> String
Handy pretty printer to help make sense of the global dependence term environment
showTyScheme :: TyScheme -> String
Pretty print type scheme
rel :: TyTerm -> TyTerm -> TyTerm
The first var is the value term, and the second is the structure term
relNonOrd :: Term l (FunctionToken TyToken)
getTupleAccessorFun :: Int -> Int -> (String, Idx)
getTupleAccessorFun takes the tuple size and tuple length |and returns the function-name and var id of the tuple |accessor function.
typeSchemesToTerms :: Map Idx TyScheme -> Map Idx TyTerm
typeSchemesToTermsassignNewTypes transforms a map of type schemes, to type terms |but raises an error if any polymorphic type schemes remain.
nullTy :: Term l (FunctionToken TyToken)
boolTy :: Term l (FunctionToken TyToken)
floatTy :: Term l (FunctionToken TyToken)
findDefaultSubsts :: TyEnv -> Substs TyTerm
findDefaultSubsts takes some type terms and returns a list of |substitutions for those type vars that should be replaced with default values.