-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Type-level assertion operators.
--   
--   Type-level unit testing via assertion operators/functions.
@package tao
@version 1.0.0

module Tao

-- | Asserts that the expected type is equal to the actual type.
--   
--   Roughly an alias for <a>AssertEq</a>, but as an operator.
type family (expected :: (Symbol, k)) @=? (actual :: k) :: ()
infix 1 @=?

-- | Asserts that the actual type is equal to the expected type.
--   
--   Roughly an alias for <a>AssertEq</a>, but as an operator.
type family (actual :: k) @?= (expected :: (Symbol, k)) :: ()
infix 1 @?=

-- | Pairs an assertion message with an expected type.
type family (msg :: Symbol) @<> (expected :: k) :: (Symbol, k)
infix 2 @<>

-- | Pairs an assertion message with an expected type. Flipped version of
--   <a>@&lt;&gt;</a>.
type family (expected :: k) <>@ (msg :: Symbol) :: (Symbol, k)
infix 2 <>@

-- | Operator version of <a>AssertBool</a>.
type family (msg :: Symbol) @<>? (result :: Bool) :: ()
infix 2 @<>?

-- | Flipped, operator version of <a>AssertBool</a>.
type family (result :: Bool) ?<>@ (msg :: Symbol) :: ()
infix 2 ?<>@

-- | Asserts that the type-level condition is true. Returns unit when the
--   condition is true and produces a type error otherwise. The input
--   <a>Symbol</a> is a message that is displayed as part of the type
--   error.
type family AssertBool (msg :: Symbol) (condition :: Bool) :: ()

-- | Asserts that the expected type is equal to the actual type. Returns
--   unit when the types are equal and produces a type error otherwise. The
--   input <a>Symbol</a> is a message that is displayed as part of the type
--   error.
type family AssertEq (msg :: Symbol) (expected :: k) (actual :: k) :: ()

-- | Helper for the implementation of <a>AssertEq</a>. Users should never
--   need to use this directly.
type family AssertEq' (msg :: Symbol) (expected :: k) (actual :: k) (result :: Bool) :: ()

-- | Helper function to fold a bunch of type-level units down to a single
--   unit. This is convenient for squashing down a type-level list of
--   assert results.
type family AssertAll (xs :: [()]) :: ()
