| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Language.Futhark.TypeChecker.Terms.Unsized
Description
Unsized type checking.
This checker generates type constraints (type CtTy) which are then solved
to find a solution. The result is a decorated AST where most of the type
annotations are just references to type variables. Further, all the
size-specific annotations (e.g. existential sizes) just contain dummy values,
such as empty lists.
If Futhark had no fancy type system features, then this pass would essentially be all you needed.
Synopsis
- checkValDef :: (VName, Maybe (TypeExp (ExpBase (NoInfo :: Type -> Type) VName) VName), [TypeParam], [PatBase (NoInfo :: Type -> Type) VName ParamType], ExpBase (NoInfo :: Type -> Type) VName, SrcLoc) -> TypeM (Either TypeError ([TypeParam], Map TyVar (TypeBase () NoMode)), [Pat ParamType], Maybe (TypeExp Exp VName), Exp)
- checkSingleExp :: ExpBase (NoInfo :: Type -> Type) VName -> TypeM (Either TypeError ([TypeParam], Map TyVar (TypeBase () NoMode)), Exp)
- checkSizeExp :: ExpBase (NoInfo :: Type -> Type) VName -> TypeM (Either TypeError ([UnconTyVar], Map TyVar (TypeBase () NoMode)), Exp)
- type Solution = Map TyVar (Either [PrimType] (TypeBase () NoMode))
Documentation
checkValDef :: (VName, Maybe (TypeExp (ExpBase (NoInfo :: Type -> Type) VName) VName), [TypeParam], [PatBase (NoInfo :: Type -> Type) VName ParamType], ExpBase (NoInfo :: Type -> Type) VName, SrcLoc) -> TypeM (Either TypeError ([TypeParam], Map TyVar (TypeBase () NoMode)), [Pat ParamType], Maybe (TypeExp Exp VName), Exp) Source #
Type check a single value definition.
checkSingleExp :: ExpBase (NoInfo :: Type -> Type) VName -> TypeM (Either TypeError ([TypeParam], Map TyVar (TypeBase () NoMode)), Exp) Source #
Type check a single expression, which may have a polymorphic type.