| Safe Haskell | None | 
|---|---|
| Language | Haskell98 | 
Language.PureScript.Types
Description
Data types for types
- newtype SkolemScope = SkolemScope {}
 - data Type
- = TUnknown Int
 - | TypeVar String
 - | TypeWildcard
 - | TypeConstructor (Qualified (ProperName TypeName))
 - | TypeApp Type Type
 - | ForAll String Type (Maybe SkolemScope)
 - | ConstrainedType [Constraint] Type
 - | Skolem String Int SkolemScope (Maybe SourceSpan)
 - | REmpty
 - | RCons String Type Type
 - | KindedType Type Kind
 - | PrettyPrintFunction Type Type
 - | PrettyPrintObject Type
 - | PrettyPrintForAll [String] Type
 
 - type Constraint = (Qualified (ProperName ClassName), [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
 - containsWildcards :: Type -> Bool
 - 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
 - everythingWithContextOnTypes :: s -> r -> (r -> r -> r) -> (s -> Type -> (s, r)) -> Type -> r
 
Documentation
newtype SkolemScope Source
An identifier for the scope of a skolem variable
Constructors
| SkolemScope | |
Fields  | |
Instances
| Eq SkolemScope Source | |
| Ord SkolemScope Source | |
| Read SkolemScope Source | |
| Show SkolemScope Source | |
| FromJSON SkolemScope Source | |
| ToJSON SkolemScope Source | 
The type of types
Constructors
| TUnknown Int | A unification variable of type Type  | 
| TypeVar String | A named type variable  | 
| TypeWildcard | A type wildcard, as would appear in a partial type synonym  | 
| TypeConstructor (Qualified (ProperName TypeName)) | A type constructor  | 
| TypeApp Type Type | A type application  | 
| ForAll String Type (Maybe SkolemScope) | Forall quantifier  | 
| ConstrainedType [Constraint] Type | A type with a set of type class constraints  | 
| Skolem String Int SkolemScope (Maybe SourceSpan) | A skolem constant  | 
| REmpty | An empty row  | 
| RCons String Type Type | A non-empty row  | 
| KindedType Type Kind | A type with a kind annotation  | 
| PrettyPrintFunction Type Type | A placeholder used in pretty printing  | 
| PrettyPrintObject Type | A placeholder used in pretty printing  | 
| PrettyPrintForAll [String] Type | A placeholder used in pretty printing  | 
type Constraint = (Qualified (ProperName ClassName), [Type]) Source
A typeclass constraint
rowToList :: Type -> ([(String, Type)], Type) Source
Convert a row to a list of pairs of labels and types
isMonoType :: Type -> Bool Source
Check whether a type is a monotype
replaceTypeVars :: String -> Type -> Type -> Type Source
Replace a type variable, taking into account variable shadowing
replaceAllTypeVars :: [(String, Type)] -> Type -> Type Source
Replace named type variables with types
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
quantify :: Type -> Type Source
Universally quantify over all type variables appearing free in a type
moveQuantifiersToFront :: Type -> Type Source
Move all universal quantifiers to the front of a type
containsWildcards :: Type -> Bool Source
Check if a type contains wildcards
everywhereOnTypesM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m Type Source
everywhereOnTypesTopDownM :: (Functor m, Applicative m, Monad m) => (Type -> m Type) -> Type -> m Type Source
everythingOnTypes :: (r -> r -> r) -> (Type -> r) -> Type -> r Source
everythingWithContextOnTypes :: s -> r -> (r -> r -> r) -> (s -> Type -> (s, r)) -> Type -> r Source