Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- cleanupErrors :: [(Range, Error)] -> [(Range, Error)]
- subsumes :: (Range, Error) -> (Range, Error) -> Bool
- data Warning
- data Error
- = KindMismatch (Maybe TypeSource) Kind Kind
- | TooManyTypeParams Int Kind
- | TyVarWithParams
- | TooManyTySynParams Name Int
- | TooFewTyParams Name Int
- | RecursiveTypeDecls [Name]
- | TypeMismatch TypeSource Type Type
- | RecursiveType TypeSource Type Type
- | UnsolvedGoals [Goal]
- | UnsolvableGoals [Goal]
- | UnsolvedDelayedCt DelayedCt
- | UnexpectedTypeWildCard
- | TypeVariableEscaped TypeSource Type [TParam]
- | NotForAll TypeSource TVar Type
- | TooManyPositionalTypeParams
- | CannotMixPositionalAndNamedTypeParams
- | UndefinedTypeParameter (Located Ident)
- | RepeatedTypeParameter Ident [Range]
- | AmbiguousSize TVarInfo (Maybe Type)
- | UndefinedExistVar Name
- | TypeShadowing String Name String
- | MissingModTParam (Located Ident)
- | MissingModVParam (Located Ident)
- errorImportance :: Error -> Int
- explainUnsolvable :: NameMap -> [Goal] -> Doc
- computeFreeVarNames :: [(Range, Warning)] -> [(Range, Error)] -> NameMap
Documentation
subsumes :: (Range, Error) -> (Range, Error) -> Bool Source #
Should the first error suppress the next one.
Instances
Various errors that might happen during type checking/inference
KindMismatch (Maybe TypeSource) Kind Kind | Expected kind, inferred kind |
TooManyTypeParams Int Kind | Number of extra parameters, kind of result
(which should not be of the form |
TyVarWithParams | A type variable was applied to some arguments. |
TooManyTySynParams Name Int | Type-synonym, number of extra params |
TooFewTyParams Name Int | Who is missing params, number of missing params |
RecursiveTypeDecls [Name] | The type synonym declarations are recursive |
TypeMismatch TypeSource Type Type | Expected type, inferred type |
RecursiveType TypeSource Type Type | Unification results in a recursive type |
UnsolvedGoals [Goal] | A constraint that we could not solve, usually because there are some left-over variables that we could not infer. |
UnsolvableGoals [Goal] | A constraint that we could not solve and we know it is impossible to do it. |
UnsolvedDelayedCt 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 TypeSource Type [TParam] | Unification variable depends on quantified variables that are not in scope. |
NotForAll TypeSource TVar Type | Quantified type variables (of kind *) need to match the given type, so it does not work for all types. |
TooManyPositionalTypeParams | Too many positional type arguments, in an explicit type instantiation |
CannotMixPositionalAndNamedTypeParams | |
UndefinedTypeParameter (Located Ident) | |
RepeatedTypeParameter Ident [Range] | |
AmbiguousSize TVarInfo (Maybe Type) | Could not determine the value of a numeric type variable, but we know it must be at least as large as the given type (or unconstrained, if Nothing). |
UndefinedExistVar Name | |
TypeShadowing String Name String | |
MissingModTParam (Located Ident) | |
MissingModVParam (Located Ident) |
Instances
errorImportance :: Error -> Int Source #
When we have multiple errors on the same location, we show only the ones with the has highest rating according to this function.