Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types for types
- newtype SkolemScope = SkolemScope {}
- data Type
- = TUnknown Int
- | TypeVar Text
- | TypeLevelString PSString
- | TypeWildcard SourceSpan
- | TypeConstructor (Qualified (ProperName TypeName))
- | TypeOp (Qualified (OpName TypeOpName))
- | TypeApp Type Type
- | ForAll Text Type (Maybe SkolemScope)
- | ConstrainedType Constraint Type
- | Skolem Text Int SkolemScope (Maybe SourceSpan)
- | REmpty
- | RCons Label Type Type
- | KindedType Type Kind
- | PrettyPrintFunction Type Type
- | PrettyPrintObject Type
- | PrettyPrintForAll [Text] Type
- | BinaryNoParensType Type Type Type
- | ParensInType Type
- data ConstraintData = PartialConstraintData [[Text]] Bool
- data Constraint = Constraint {}
- mapConstraintArgs :: ([Type] -> [Type]) -> Constraint -> Constraint
- overConstraintArgs :: Functor f => ([Type] -> f [Type]) -> Constraint -> f Constraint
- rowToList :: Type -> ([(Label, Type)], Type)
- rowToSortedList :: Type -> ([(Label, Type)], Type)
- rowFromList :: ([(Label, Type)], Type) -> Type
- isMonoType :: Type -> Bool
- mkForAll :: [Text] -> Type -> Type
- replaceTypeVars :: Text -> Type -> Type -> Type
- replaceAllTypeVars :: [(Text, Type)] -> Type -> Type
- usedTypeVariables :: Type -> [Text]
- freeTypeVariables :: Type -> [Text]
- quantify :: Type -> Type
- moveQuantifiersToFront :: Type -> Type
- containsWildcards :: Type -> Bool
- containsForAll :: Type -> Bool
- everywhereOnTypes :: (Type -> Type) -> Type -> Type
- everywhereOnTypesTopDown :: (Type -> Type) -> Type -> Type
- everywhereOnTypesM :: Monad m => (Type -> m Type) -> Type -> m Type
- everywhereOnTypesTopDownM :: 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
The type of types
TUnknown Int | A unification variable of type Type |
TypeVar Text | A named type variable |
TypeLevelString PSString | A type-level string |
TypeWildcard SourceSpan | A type wildcard, as would appear in a partial type synonym |
TypeConstructor (Qualified (ProperName TypeName)) | A type constructor |
TypeOp (Qualified (OpName TypeOpName)) | A type operator. This will be desugared into a type constructor during the "operators" phase of desugaring. |
TypeApp Type Type | A type application |
ForAll Text Type (Maybe SkolemScope) | Forall quantifier |
ConstrainedType Constraint Type | A type with a set of type class constraints |
Skolem Text Int SkolemScope (Maybe SourceSpan) | A skolem constant |
REmpty | An empty row |
RCons Label 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 [Text] Type | A placeholder used in pretty printing |
BinaryNoParensType Type Type Type | Binary operator application. During the rebracketing phase of desugaring, this data constructor will be removed. |
ParensInType Type | Explicit parentheses. During the rebracketing phase of desugaring, this data constructor will be removed. Note: although it seems this constructor is not used, it _is_ useful, since it prevents certain traversals from matching. |
data ConstraintData Source #
Additional data relevant to type class constraints
PartialConstraintData [[Text]] Bool | Data to accompany a Partial constraint generated by the exhaustivity checker.
It contains (rendered) binder information for those binders which were
not matched, and a flag indicating whether the list was truncated or not.
Note: we use |
data Constraint Source #
A typeclass constraint
Constraint | |
|
mapConstraintArgs :: ([Type] -> [Type]) -> Constraint -> Constraint Source #
overConstraintArgs :: Functor f => ([Type] -> f [Type]) -> Constraint -> f Constraint Source #
rowToList :: Type -> ([(Label, Type)], Type) Source #
Convert a row to a list of pairs of labels and types
rowToSortedList :: Type -> ([(Label, Type)], Type) Source #
Convert a row to a list of pairs of labels and types, sorted by the labels.
isMonoType :: Type -> Bool Source #
Check whether a type is a monotype
replaceTypeVars :: Text -> Type -> Type -> Type Source #
Replace a type variable, taking into account variable shadowing
replaceAllTypeVars :: [(Text, Type)] -> Type -> Type Source #
Replace named type variables with types
usedTypeVariables :: Type -> [Text] Source #
Collect all type variables appearing in a type
freeTypeVariables :: Type -> [Text] 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
containsForAll :: Type -> Bool Source #
Check if a type contains forall
everythingOnTypes :: (r -> r -> r) -> (Type -> r) -> Type -> r Source #
everythingWithContextOnTypes :: s -> r -> (r -> r -> r) -> (s -> Type -> (s, r)) -> Type -> r Source #