type-spec-0.4.0.0: Type Level Specification by Example

Copyright(c) Sven Heyll 2016
LicenseBSD-3
Maintainersven.heyll@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Test.TypeSpec

Contents

Description

A tiny EDSL to write type-level-unit tests.

A simple example:

specHelloWorld :: Expect (Int `Isn't` Bool)
specHelloWorld = Valid

We can also expect a bit more using lists and tuples:

specGrouped
  :: Expect '[ Int  `Isn't` Bool
             , Int  `Is`    Int
             , Bool `Is`    Bool  `ButNot`  String
             ]
specGrouped = Valid

The expectations are executed by the compiler when solving the constraints of TypeSpecs constructors.

A TypeSpec also has a Show instance, which can be used in real unit tests to print the expectations.

This module contains mainly re-exports of.

Synopsis

TypeSpec Aliases

type Explain does this = TypeSpec (It does this) Source #

ShouldBe aliases

ShouldNotBe aliases

ShouldBeTrue aliases

ShouldBeFalse aliases

Labelling Aliases

type They message expectations = It message expectations Source #

type It's = It Source #

Reexports