| Copyright | (c) 2013-2015 Galois, Inc. |
|---|---|
| License | BSD3 |
| Maintainer | cryptol@galois.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell98 |
Cryptol.TypeCheck.InferTypes
Description
This module contains types used during type inference.
- data VarType
- newtype Goals = Goals (TypeMap Goal)
- emptyGoals :: Goals
- nullGoals :: Goals -> Bool
- fromGoals :: Goals -> [Goal]
- insertGoal :: Goal -> Goals -> Goals
- data Goal = Goal {
- goalSource :: ConstraintSource
- goalRange :: Range
- goal :: Prop
- data HasGoal = HasGoal {}
- data DelayedCt = DelayedCt {}
- data Solved
- data Warning
- data Error
- = ErrorMsg Doc
- | KindMismatch Kind Kind
- | TooManyTypeParams Int Kind
- | TooManyTySynParams QName Int
- | TooFewTySynParams QName Int
- | RepeatedTyParams [TParam]
- | RepeatedDefinitions QName [Range]
- | RecursiveTypeDecls [LQName]
- | UndefinedTypeSynonym QName
- | UndefinedVariable QName
- | UndefinedTypeParam QName
- | MultipleTypeParamDefs QName [Range]
- | TypeMismatch Type Type
- | RecursiveType Type Type
- | UnsolvedGoal Goal
- | UnsolvedDelcayedCt DelayedCt
- | UnexpectedTypeWildCard
- | TypeVariableEscaped Type [TVar]
- | NotForAll TVar Type
- | UnusableFunction QName Prop
- | TooManyPositionalTypeParams
- | CannotMixPositionalAndNamedTypeParams
- | AmbiguousType [QName]
- data ConstraintSource
- data TyFunName
- cppKind :: Kind -> Doc
- addTVarsDescs :: FVS t => NameMap -> t -> Doc -> Doc
- ppUse :: Expr -> Doc
Documentation
The types of variables in the environment.
insertGoal :: Goal -> Goals -> Goals Source
Something that we need to find evidence for.
Constructors
| Goal | |
Fields
| |
Delayed implication constraints, arising from user-specified type sigs.
Constructors
| DelayedCt | |
Constructors
| DefaultingKind TParam Kind | |
| DefaultingWildType Kind | |
| DefaultingTo Doc Type |
Various errors that might happen during type checking/inference
Constructors
| ErrorMsg Doc | Just say this |
| KindMismatch Kind Kind | Expected kind, inferred kind |
| TooManyTypeParams Int Kind | Number of extra parameters, kind of resut
(which should not be of the form |
| TooManyTySynParams QName Int | Type-synonym, number of extra params |
| TooFewTySynParams QName Int | Type-synonym, number of missing params |
| RepeatedTyParams [TParam] | Type parameters with the same name (in definition) |
| RepeatedDefinitions QName [Range] | Multiple definitions for the same name |
| RecursiveTypeDecls [LQName] | The type synonym declarations are recursive |
| UndefinedTypeSynonym QName | Use of a type synonym that was not defined |
| UndefinedVariable QName | Use of a variable that was not defined |
| UndefinedTypeParam QName | Attempt to explicitly instantiate a non-existent param. |
| MultipleTypeParamDefs QName [Range] | Multiple definitions for the same type parameter |
| TypeMismatch Type Type | Expected type, inferred type |
| RecursiveType Type Type | Unification results in a recursive type |
| UnsolvedGoal Goal | A constraint that we could not solve |
| UnsolvedDelcayedCt DelayedCt | A constraint (with context) that we could not solve |
| UnexpectedTypeWildCard | Type wild cards are not allowed in this context (e.g., definitions of type synonyms). |
| TypeVariableEscaped Type [TVar] | Unification variable depends on quantified variables that are not in scope. |
| NotForAll TVar Type | Quantified type variables (of kind *) needs to match the given type, so it does not work for all types. |
| UnusableFunction QName Prop | The given constraint causes the signature of the function to be not-satisfiable. |
| TooManyPositionalTypeParams | Too many positional type arguments, in an explicit type instantiation |
| CannotMixPositionalAndNamedTypeParams | |
| AmbiguousType [QName] |
data ConstraintSource Source
Information about how a constraint came to be, used in error reporting.
Constructors
| CtComprehension | Computing shape of list comprehension |
| CtSplitPat | Use of a split pattern |
| CtTypeSig | A type signature in a pattern or expression |
| CtInst Expr | Instantiation of this expreesion |
| CtSelector | |
| CtExactType | |
| CtEnumeration | |
| CtDefaulting | Just defaulting on the command line |
| CtPartialTypeFun TyFunName | Use of a partial type function. |
Constructors
| UserTyFun QName | |
| BuiltInTyFun TFun |