tasty-laws-0.3: Test common laws

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Laws.Monad

Description

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

import qualified Test.Tasty.Laws.Monad as Monad

Synopsis

Documentation

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

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

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

tasty TestTree for Monad laws. Monomorphic sum Series.

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

tasty TestTree for Monad laws. Monomorphic product Series.