fmap id = id
fmap (g . f) = fmap g . fmap f
pure id <*> v = v
pure f <*> pure x = pure (f x)
u :: Applicative u <*> pure v = pure ($ v) <*> u
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
pure a >>= f = f
m >>= pure = m
(m >>= f) >>= g = (\x -> f x >>= g) Essentially stating that you can move around paren order and it won't matter Are all monads monoids? or semigroups?
-
Implement the Arbitrary instance for your new type ( can just use the arbitrary instances of inner prelude types )
-
Write a function which represents one of the laws
-
Then call quickCheck which will run many different tests to verify that your implementation is correct