HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduledhall-1.42.3Haskell2010

Dhall.TypeCheck

This module contains the logic for type checking Dhall code

  • 7 types
  • 7 values
  • Packagedhall-1.42.3
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypeCheck.hs

Type-checking

5 declarations
valuetypeWith
  1. :: Context (Expr s X)
  2. -> Expr s X
  3. -> Either (TypeError s X) (Expr s X)
#

Type-check an expression and return the expression's type if type-checking succeeds or an error if type-checking fails

typeWith does not necessarily normalize the type since full normalization is not necessary for just type-checking. If you actually care about the returned type then you may want to normalize it afterwards.

The supplied Context records the types of the names in scope. If these are ill-typed, the return value may be ill-typed.

Types

9 declarations
typetype Typer a = forall s. a -> Expr s a
#

Function that converts the value inside an Embed constructor into a new expression

typetype X = Void
#

Deprecated. Use Data.Void.Void instead

A type synonym for Void

This is provided for backwards compatibility, since Dhall used to use its own X type instead of Data.Void.Void. You should use Void instead of X now

valueabsurd :: Void -> a
#

Since Void values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet".

Example2 expressions
let x :: Either Void Int; x = Right 5:{case x of    Right r -> r    Left l  -> absurd l:}5
datadata TypeError s a
#

A structured type error that includes context

Instances3Show, Exception, Pretty
newtypenewtype DetailedTypeError s a
#

Newtype used to wrap error messages so that they render with a more detailed explanation of what went wrong

Constructors

Instances3Show, Exception, Pretty
datadata TypeMessage s a
#

The specific type error

Constructors

Instances1Show