dhall-1.0.2: A configuration language guaranteed to terminate

Safe HaskellNone
LanguageHaskell98

Dhall.TypeCheck

Contents

Description

This module contains the logic for type checking Dhall code

Synopsis

Type-checking

typeWith :: Context (Expr s X) -> Expr s X -> Either (TypeError s) (Expr s X) Source #

Type-check an expression and return the expression's type if type-checking suceeds 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.

typeOf :: Expr s X -> Either (TypeError s) (Expr s X) Source #

typeOf is the same as typeWith with an empty context, meaning that the expression must be closed (i.e. no free variables), otherwise type-checking will fail.

Types

newtype X Source #

Like Void, except with a shorter inferred type

Constructors

X 

Fields

Instances

Show X Source # 

Methods

showsPrec :: Int -> X -> ShowS #

show :: X -> String #

showList :: [X] -> ShowS #

Buildable X Source # 

Methods

build :: X -> Builder #

data TypeError s Source #

A structured type error that includes context

Constructors

TypeError 

newtype DetailedTypeError s Source #

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

Constructors

DetailedTypeError (TypeError s) 

data TypeMessage s Source #

The specific type error

Instances