| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rzk.Check.Conversion
Description
Subtyping and conversion, in the checker's monad.
The library's conversion decides the common case: two values compared in the context's variance. Where it answers no, the checker explains the failure on the heads, with the term whose type is compared where a restriction needs it: a term of an unrestricted type stands at a restricted one when it agrees with each face, and a function does so when its applications do. There is no unification: a mismatch is an error.
Synopsis
- subtype :: forall (n :: S). Distinct n => Core n -> Value n -> Value n -> Check n ()
- subtypeValues :: forall (n :: S). Distinct n => Value n -> Value n -> Check n ()
- convertTerms :: forall (n :: S). Distinct n => Value n -> Value n -> Check n ()
- convertTypes :: forall (n :: S). Distinct n => Value n -> Value n -> Check n ()
- holesTolerated :: forall (n :: S). Core n -> Check n Bool
Documentation
subtype :: forall (n :: S). Distinct n => Core n -> Value n -> Value n -> Check n () Source #
Check that the actual type of a term is a subtype of the expected type. The arguments are the term, its expected type, and its actual inferred type.
subtypeValues :: forall (n :: S). Distinct n => Value n -> Value n -> Check n () Source #
Check that the second type (actual) is a subtype of the first (expected), with no term at hand.
convertTerms :: forall (n :: S). Distinct n => Value n -> Value n -> Check n () Source #
Two terms are convertible.