tasty-quickcheck-laws-0.0.2: Pre-built tasty trees for checking lawful class properties using QuickCheck

Copyright2019 Automattic Inc.
LicenseBSD3
MaintainerNathan Bloomfield (nbloomf@gmail.com)
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Test.Tasty.QuickCheck.Laws.MaybeMonad

Contents

Description

 
Synopsis

Documentation

testMaybeMonadLaws Source #

Arguments

:: (Monad m, Eq a, Show t, Show a, Show (m a), Arbitrary t, Arbitrary a, Arbitrary (m a), Typeable m, Typeable a) 
=> Proxy m

Type constructor under test

-> Proxy t

Equality context for m

-> Proxy a

Value type

-> (forall u. Eq u => t -> m u -> m u -> Bool)

Equality test

-> (forall a. m a)
bail
-> TestTree 

Constructs a TestTree checking that the maybe monad laws hold for m with maybe type r and value types a and b, using a given equality test for values of type forall u. m u. The equality context type t is for constructors m from which we can only extract a value within a context, such as reader-like constructors.

Maybe Monad Laws

testMaybeMonadLawBailThen Source #

Arguments

:: (Monad m, Eq a, Show t, Arbitrary t, Arbitrary (m a), Show (m a)) 
=> Proxy m

Type constructor under test

-> Proxy t

Equality context for m

-> Proxy a

Value type

-> (forall u. Eq u => t -> m u -> m u -> Bool)

Equality test

-> (forall a. m a)
bail
-> TestTree 
bail >> x === bail