Safe Haskell | Safe-Infered |
---|
A representation of type schemes. A type scheme is a (qualified) type with a number of quantifiers (foralls) in front of it. A partial mapping from type variable (Int) to their name (String) is preserved.
- type TpScheme = Forall QType
- type QType = Qualification Predicates Tp
- class IsTpScheme a where
- toTpScheme :: a -> TpScheme
- arityOfTpScheme :: TpScheme -> Int
- genericInstanceOf :: OrderedTypeSynonyms -> ClassEnvironment -> TpScheme -> TpScheme -> Bool
- isOverloaded :: TpScheme -> Bool
- makeScheme :: [Int] -> Predicates -> Tp -> TpScheme
- instantiateWithNameMap :: Int -> TpScheme -> (Int, Predicates, Tp)
- type Scheme qs = Forall (Qualification qs Tp)
- data Sigma qs
- = SigmaVar SigmaVar
- | SigmaScheme (Scheme qs)
- type SigmaVar = Int
- type TpSchemeMap = Map SigmaVar TpScheme
- type SigmaPreds = Sigma Predicates
- class IsSigmaPreds a where
- toSigmaPreds :: a -> SigmaPreds
Type schemes
type TpScheme = Forall QTypeSource
A type scheme consists of a list of quantified type variables, a finite map that partially maps these type variables to their original identifier, and a qualified type.
type QType = Qualification Predicates TpSource
class IsTpScheme a whereSource
A type class to convert something into a type scheme
toTpScheme :: a -> TpSchemeSource
Basic functionality for types and type schemes
arityOfTpScheme :: TpScheme -> IntSource
Determine the arity of a type scheme.
genericInstanceOf :: OrderedTypeSynonyms -> ClassEnvironment -> TpScheme -> TpScheme -> BoolSource
isOverloaded :: TpScheme -> BoolSource
Is the type scheme overloaded (does it contain predicates)?
makeScheme :: [Int] -> Predicates -> Tp -> TpSchemeSource
instantiateWithNameMap :: Int -> TpScheme -> (Int, Predicates, Tp)Source
type Scheme qs = Forall (Qualification qs Tp)Source
A sigma is a type scheme or a type scheme variable
IsSigmaPreds SigmaPreds | |
(ShowQualifiers qs, Substitutable qs) => Show (Sigma qs) | |
Substitutable qs => Substitutable (Sigma qs) | |
(Substitutable qs, ShowQualifiers qs) => ShowQuantors (Sigma qs) |
type TpSchemeMap = Map SigmaVar TpSchemeSource
A substitution for type scheme variables
type SigmaPreds = Sigma PredicatesSource