tasty-laws-0.3: Test common laws

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Laws.Applicative

Description

This module is intended to be imported qualified, for example:

import qualified Test.Tasty.Laws.Applicative as Applicative

Synopsis

Documentation

test :: (Applicative f, Eq (f ()), Eq (f (f ())), Show (f ()), Show (f (() -> ())), Serial Identity (f ()), Serial IO (f ()), Serial IO (f (() -> ()))) => Series IO (f ()) -> TestTree Source

tasty TestTree for Applicative laws. The type signature forces the parameter to be '()' which, unless you are dealing with non-total functions, should be enough to test any Applicatives.

testMono :: forall f a. (Applicative f, Eq a, Eq (f a), Eq (f (f a)), Show a, Show (f a), Show (f (a -> a)), Serial Identity a, Serial Identity (f a), Serial IO a, Serial IO (f a), Serial IO (a -> a), Serial IO (f (a -> a))) => Series IO (f a) -> TestTree Source

tasty TestTree for Applicative laws. Monomorphic sum Series.

testMonoExhaustive :: forall f a. (Applicative f, Eq a, Eq (f a), Eq (f (f a)), Show a, Show (f a), Show (f (a -> a)), Serial Identity a, Serial Identity (f a), Serial IO a, Serial IO (f a), Serial IO (a -> a), Serial IO (f (a -> a))) => Series IO (f a) -> TestTree Source

tasty TestTree for Applicative laws. Monomorphic product Series.