Safe Haskell | None |
---|
Data types for types
- newtype SkolemScope = SkolemScope {}
- data Type
- = TUnknown Unknown
- | TypeVar String
- | TypeConstructor (Qualified ProperName)
- | TypeApp Type Type
- | SaturatedTypeSynonym (Qualified ProperName) [Type]
- | ForAll String Type (Maybe SkolemScope)
- | ConstrainedType [(Qualified ProperName, [Type])] Type
- | Skolem String Int SkolemScope
- | REmpty
- | RCons String Type Type
- | PrettyPrintFunction Type Type
- | PrettyPrintArray Type
- | PrettyPrintObject Type
- | PrettyPrintForAll [String] Type
- rowToList :: Type -> ([(String, Type)], Type)
- rowFromList :: ([(String, Type)], Type) -> Type
- isMonoType :: Type -> Bool
- mkForAll :: [String] -> Type -> Type
- replaceTypeVars :: String -> Type -> Type -> Type
- replaceAllTypeVars :: [(String, Type)] -> Type -> Type
- usedTypeVariables :: Type -> [String]
- freeTypeVariables :: Type -> [String]
- quantify :: Type -> Type
- moveQuantifiersToFront :: Type -> Type
- everywhereOnTypes :: (Type -> Type) -> Type -> Type
- everywhereOnTypesTopDown :: (Type -> Type) -> Type -> Type
- everywhereOnTypesM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m Type
- everywhereOnTypesTopDownM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m Type
- everythingOnTypes :: (r -> r -> r) -> (Type -> r) -> Type -> r
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 |
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 String Int SkolemScope | A skolem constant |
REmpty | An empty row |
RCons String Type Type | A non-empty row |
PrettyPrintFunction Type Type | A placeholder used in pretty printing |
PrettyPrintArray Type | A placeholder used in pretty printing |
PrettyPrintObject Type | A placeholder used in pretty printing |
PrettyPrintForAll [String] Type | A placeholder used in pretty printing |
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 :: String -> Type -> Type -> TypeSource
Replace a type variable, taking into account variable shadowing
usedTypeVariables :: Type -> [String]Source
Collect all type variables appearing in a type
freeTypeVariables :: Type -> [String]Source
Collect all free type variables appearing in a type
moveQuantifiersToFront :: Type -> TypeSource
Move all universal quantifiers to the front of a type
everywhereOnTypesM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m TypeSource
everywhereOnTypesTopDownM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m TypeSource
everythingOnTypes :: (r -> r -> r) -> (Type -> r) -> Type -> rSource