cryptol-2.6.0: Cryptol: The Language of Cryptography

Safe Haskell | Safe
Language | Haskell2010

Cryptol.TypeCheck.Error

Synopsis

- cleanupErrors :: [(Range, Error)] -> [(Range, Error)]
- subsumes :: Error -> Error -> Bool
- data Warning
  - = DefaultingKind (TParam Name) Kind
  - | DefaultingWildType Kind
  - | DefaultingTo TVarInfo Type
- data Error
  - = ErrorMsg Doc
  - | KindMismatch Kind Kind
  - | TooManyTypeParams Int Kind
  - | TyVarWithParams
  - | TooManyTySynParams Name Int
  - | TooFewTySynParams Name Int
  - | RecursiveTypeDecls [Name]
  - | TypeMismatch Type Type
  - | RecursiveType Type Type
  - | UnsolvedGoals Bool [Goal]
  - | UnsolvedDelayedCt DelayedCt
  - | UnexpectedTypeWildCard
  - | TypeVariableEscaped Type [TParam]
  - | NotForAll TVar Type
  - | UnusableFunction Name [Prop]
  - | TooManyPositionalTypeParams
  - | CannotMixPositionalAndNamedTypeParams
  - | UndefinedTypeParameter (Located Ident)
  - | RepeatedTypeParameter Ident [Range]
  - | AmbiguousType [Name] [TVar]

# Documentation

cleanupErrors :: [(Range, Error)] -> [(Range, Error)] Source #

subsumes :: Error -> Error -> Bool Source #

Should the first error suppress the next one.

data Warning Source #

Constructors

DefaultingKind (TParam Name) Kind |
DefaultingWildType Kind |
DefaultingTo TVarInfo Type |

Instances

Show Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods showsPrec :: Int -> Warning -> ShowS Source # show :: Warning -> String Source # showList :: [Warning] -> ShowS Source #
Generic Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Associated Types type Rep Warning :: Type -> Type Source # Methods from :: Warning -> Rep Warning x Source # to :: Rep Warning x -> Warning Source #
NFData Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods rnf :: Warning -> () Source #
PP Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> Warning -> Doc Source #
FVS Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods fvs :: Warning -> Set TVar Source #
TVars Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods apSubst :: Subst -> Warning -> Warning Source #
PP (WithNames Warning) Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> WithNames Warning -> Doc Source #
type Rep Warning Source # |

Instance details

Defined in Cryptol.TypeCheck.Error

type Rep Warning = D1 (MetaData "Warning" "Cryptol.TypeCheck.Error" "cryptol-2.6.0-FO78l5UWBYr51eDL1ksQpO" False) (C1 (MetaCons "DefaultingKind" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (TParam Name)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Kind)) :+: (C1 (MetaCons "DefaultingWildType" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Kind)) :+: C1 (MetaCons "DefaultingTo" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TVarInfo) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type))))

data Error Source #

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 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
TooFewTySynParams Name Int | Type-synonym, number of missing params
RecursiveTypeDecls [Name] | The type synonym declarations are recursive
TypeMismatch Type Type | Expected type, inferred type
RecursiveType Type Type | Unification results in a recursive type
UnsolvedGoals Bool [Goal] | A constraint that we could not solve The boolean indicates if we know that this constraint is impossible.
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 Type [TParam] | Unification variable depends on quantified variables that are not in scope.
NotForAll TVar Type | Quantified type variables (of kind *) need to match the given type, so it does not work for all types.
UnusableFunction Name [Prop] | The given constraints causes the signature of the function to be not-satisfiable.
TooManyPositionalTypeParams | Too many positional type arguments, in an explicit type instantiation
CannotMixPositionalAndNamedTypeParams |
UndefinedTypeParameter (Located Ident) |
RepeatedTypeParameter Ident [Range] |
AmbiguousType [Name] [TVar] |

Instances

Show Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods showsPrec :: Int -> Error -> ShowS Source # show :: Error -> String Source # showList :: [Error] -> ShowS Source #
Generic Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Associated Types type Rep Error :: Type -> Type Source # Methods from :: Error -> Rep Error x Source # to :: Rep Error x -> Error Source #
NFData Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods rnf :: Error -> () Source #
PP Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> Error -> Doc Source #
FVS Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods fvs :: Error -> Set TVar Source #
TVars Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods apSubst :: Subst -> Error -> Error Source #
PP (WithNames Error) Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> WithNames Error -> Doc Source #
type Rep Error Source # |

Instance details

Defined in Cryptol.TypeCheck.Error

type Rep Error = D1 (MetaData "Error" "Cryptol.TypeCheck.Error" "cryptol-2.6.0-FO78l5UWBYr51eDL1ksQpO" False) ((((C1 (MetaCons "ErrorMsg" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Doc)) :+: C1 (MetaCons "KindMismatch" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Kind) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Kind))) :+: (C1 (MetaCons "TooManyTypeParams" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Kind)) :+: (C1 (MetaCons "TyVarWithParams" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "TooManyTySynParams" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))))) :+: ((C1 (MetaCons "TooFewTySynParams" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :+: C1 (MetaCons "RecursiveTypeDecls" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]))) :+: (C1 (MetaCons "TypeMismatch" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type)) :+: (C1 (MetaCons "RecursiveType" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type)) :+: C1 (MetaCons "UnsolvedGoals" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Goal])))))) :+: (((C1 (MetaCons "UnsolvedDelayedCt" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DelayedCt)) :+: C1 (MetaCons "UnexpectedTypeWildCard" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "TypeVariableEscaped" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TParam])) :+: (C1 (MetaCons "NotForAll" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TVar) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Type)) :+: C1 (MetaCons "UnusableFunction" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Name) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Prop]))))) :+: ((C1 (MetaCons "TooManyPositionalTypeParams" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CannotMixPositionalAndNamedTypeParams" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "UndefinedTypeParameter" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located Ident))) :+: (C1 (MetaCons "RepeatedTypeParameter" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ident) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Range])) :+: C1 (MetaCons "AmbiguousType" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Name]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TVar])))))))