Copyright | 2019 Automattic Inc. |
---|---|
License | BSD3 |
Maintainer | Nathan Bloomfield (nbloomf@gmail.com) |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- testMaybeMonadLaws :: (Monad m, Eq a, Show t, Show a, Show (m a), Arbitrary t, Arbitrary a, Arbitrary (m a), Typeable m, Typeable a) => Proxy m -> Proxy t -> Proxy a -> (forall u. Eq u => t -> m u -> m u -> Bool) -> (forall a. m a) -> TestTree
- testMaybeMonadLawBailThen :: (Monad m, Eq a, Show t, Arbitrary t, Arbitrary (m a), Show (m a)) => Proxy m -> Proxy t -> Proxy a -> (forall u. Eq u => t -> m u -> m u -> Bool) -> (forall a. m a) -> TestTree
Documentation
:: (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 |
-> 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 #
:: (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 |
-> 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