Safe Haskell | None |
---|
Data types for types
- newtype SkolemScope = SkolemScope {}
- data Type
- = TUnknown Unknown
- | Object Type
- | TypeVar String
- | TypeConstructor (Qualified ProperName)
- | TypeApp Type Type
- | SaturatedTypeSynonym (Qualified ProperName) [Type]
- | ForAll String Type (Maybe SkolemScope)
- | ConstrainedType [(Qualified ProperName, Type)] Type
- | Skolem Int SkolemScope
- | REmpty
- | RCons String Type Type
- tyFunction :: Type
- tyString :: Type
- tyNumber :: Type
- tyBoolean :: Type
- tyArray :: Type
- function :: Type -> Type -> Type
- rowToList :: Type -> ([(String, Type)], Type)
- rowFromList :: ([(String, Type)], Type) -> Type
- isMonoType :: Type -> Bool
- mkForAll :: [String] -> Type -> Type
- unit :: Type
- replaceTypeVars :: Data d => String -> Type -> d -> d
Documentation
newtype SkolemScope Source
An identifier for the scope of a skolem variable
The type of types
TUnknown Unknown | A unification variable of type Type |
Object Type | Javascript numbers |
TypeVar String | A named type variable |
TypeConstructor (Qualified ProperName) | A type constructor |
TypeApp Type Type | A type application |
SaturatedTypeSynonym (Qualified ProperName) [Type] | A type synonym which is "saturated", i.e. fully applied |
ForAll String Type (Maybe SkolemScope) | Forall quantifier |
ConstrainedType [(Qualified ProperName, Type)] Type | A type with a set of type class constraints |
Skolem Int SkolemScope | A skolem constant |
REmpty | An empty row |
RCons String Type Type | A non-empty row |
Type constructor for functions
rowToList :: Type -> ([(String, Type)], Type)Source
Convert a row to a list of pairs of labels and types
isMonoType :: Type -> BoolSource
Check whether a type is a monotype
replaceTypeVars :: Data d => String -> Type -> d -> dSource
Replace a type variable, taking into account variable shadowing