rzk-0.11.4: An experimental proof assistant for synthetic ∞-categories
Safe HaskellNone
LanguageHaskell2010

Rzk.Check.Error

Description

Type errors, warnings and holes of the new checker, and how they are shown.

An error is captured at its own scope, with the context it was raised in, so that it can be shown with the names of that context. A warning and a hole are recorded already rendered, so they are independent of the scope they came from.

Synopsis

Documentation

data TypeError (n :: S) Source #

Constructors

TypeErrorOther String

a diagnostic that does not yet have a dedicated constructor

TypeErrorUnsupported String

a construct the new checker does not cover yet

TypeErrorUnify (Core n) (Value n) (Value n)

the term, the expected type and its actual type

TypeErrorUnifyTerms (Value n) (Value n)

the expected and actual values that are not convertible

TypeErrorNotPair (Core n) (Value n)

a projected term and its non-pair type

TypeErrorNotFunction (Core n) (Value n)

an applied term and its non-function type

TypeErrorUnexpectedLambda (Raw n) (Value n)

a λ checked against a non-function type

TypeErrorUnexpectedPair (Raw n) (Value n)

a pair checked against a non-pair type

TypeErrorUnexpectedRefl (Raw n) (Value n)

reflexivity checked against a non-identity type

TypeErrorCannotInferBareLambda (Raw n)

a λ without a parameter annotation in inference position

TypeErrorCannotInferBareRefl (Raw n)

reflexivity without an element annotation in inference position

TypeErrorCannotInferHole (Raw n)

a user hole whose type cannot be inferred

TypeErrorUnsolvedHole (Maybe VarIdent) (Value n)

a user hole and the goal it leaves unsolved in strict mode

TypeErrorUndefined VarIdent

an unresolved surface identifier

TypeErrorTopeNotSatisfied [Tope n] (Tope n)

context topes and the goal they do not entail

TypeErrorTopeContextDisjoint (Tope n) [Tope n]

a tope disjoint from the listed context

TypeErrorInvalidArgumentType (Raw n) (Value n)

a function parameter and its invalid kind

TypeErrorDuplicateTopLevel [VarIdent] VarIdent

previous definitions and the duplicate name

TypeErrorUnusedVariable (Name n) (Value n)

an unused section assumption and its type

TypeErrorUnusedUsedVariables [Name n] (Name n)

assumptions listed as used but not needed by the declaration

TypeErrorImplicitAssumption (Name n, Value n) (Name n)

an assumption used implicitly, its type, and the declaration using it

TypeErrorNotIntervalCube String (Value n) (Value n)

an operation and the two operand types, which are not interval cubes

TypeErrorRepeatedBinder VarIdent [VarIdent]

a repeated binder and its previous occurrences

typeErrorTag :: forall (n :: S). TypeError n -> String Source #

The constructor name: the stable code of a diagnostic, and the tag the fixtures pin.

data ErrorInContext where Source #

An error with the context it was raised in. The scope is existential: the context says what the names are called.

Constructors

ErrorInContext :: forall (n :: S). Distinct n => Context n -> TypeError n -> ErrorInContext 

ppTypeError :: forall (n :: S). Distinct n => Context n -> TypeError n -> String Source #

ppErrorInContext :: ErrorInContext -> String Source #

An error, with the context it was raised in.

ppAction :: forall (n :: S). Distinct n => Context n -> Action n -> String Source #

ppTope :: forall (n :: S). Naming n -> Tope n -> String Source #

A tope of the solver, shown with the context's names.

ppPoint :: forall (n :: S). Naming n -> Point n -> String Source #

Warnings

data Warning Source #

A warning, rendered.

Constructors

OverhangWarning String String [String] (Maybe LocationInfo)

a restriction face or a recOR branch guard, the tope, the local tope context

TopeFamilyDomainWarning String String (Maybe LocationInfo)

the family, its declared domain

ShadowingWarning String [String] (Maybe LocationInfo)

a binder, and the binding it shadows, each with where it was written

UnsupportedOptionWarning String (Maybe LocationInfo)

an option that the new checker accepts but does not implement

Instances

Instances details
Show Warning Source # 
Instance details

Defined in Rzk.Check.Error

Eq Warning Source # 
Instance details

Defined in Rzk.Check.Error

Methods

(==) :: Warning -> Warning -> Bool #

(/=) :: Warning -> Warning -> Bool #

warningTag :: Warning -> String Source #

The stable code of a warning.

Hints

data Hint Source #

A hint, rendered and independent of the scope where it was found.

Constructors

SimplificationHint String String (Maybe LocationInfo)

the original and suggested terms, rendered, and the source location

Instances

Instances details
Show Hint Source # 
Instance details

Defined in Rzk.Check.Error

Methods

showsPrec :: Int -> Hint -> ShowS #

show :: Hint -> String #

showList :: [Hint] -> ShowS #

Eq Hint Source # 
Instance details

Defined in Rzk.Check.Error

Methods

(==) :: Hint -> Hint -> Bool #

(/=) :: Hint -> Hint -> Bool #

hintTag :: Hint -> String Source #

The stable code of a hint.

Holes

data HoleInfo Source #

The goal and the context at a hole, rendered.

Constructors

HoleInfo 

Fields

Instances

Instances details
Show HoleInfo Source # 
Instance details

Defined in Rzk.Check.Error

Eq HoleInfo Source # 
Instance details

Defined in Rzk.Check.Error