Safe Haskell | None |
---|

- type Equal = []
- type Theorem = Equal
- (=.=) :: a -> a -> Theorem a
- addSteps :: Theorem a -> Equal a -> Equal a
- type family LawArgs t
- type family LawBody t
- type family Param b
- type Law t = LawArgs t -> Equal (LawBody t)
- class LawTest t where
- blindlawtest :: LawTest t => t -> Blind (LawArgs t) -> Param (LawBody t) -> Property
- partiallawtest :: LawTest t => t -> Partial (LawArgs t -> Param (LawBody t) -> Property)
- quickLawCheck :: (Show (LawArgs t), Arbitrary (LawArgs t), Show (Param (LawBody t)), Arbitrary (Param (LawBody t)), LawTest t) => t -> IO ()
- quickFLawCheck :: (Show (Param (LawBody t)), Arbitrary (LawArgs t), Arbitrary (Param (LawBody t)), LawTest t) => t -> IO ()
- quickLawCheckPartial :: (Show (Partial (Param (LawBody t))), Show (Partial (LawArgs t)), ArbitraryPartial (Param (LawBody t)), ArbitraryPartial (LawArgs t), LawTest t) => t -> IO ()

# Documentation

addSteps :: Theorem a -> Equal a -> Equal aSource

Take a two-element theorem and an equality proof chain to splice in the middle.

Class LawTest defines a test method, which returns a testable property, which we can use to test a law for a type t. This class is independent of the actual laws to test - it can be used for Monoid, Monad, ...

blindlawtest :: LawTest t => t -> Blind (LawArgs t) -> Param (LawBody t) -> PropertySource

Helper function to test laws where arguments lack a Show instance.

partiallawtest :: LawTest t => t -> Partial (LawArgs t -> Param (LawBody t) -> Property)Source

Helper function to test laws where we should care about partial values.

quickLawCheck :: (Show (LawArgs t), Arbitrary (LawArgs t), Show (Param (LawBody t)), Arbitrary (Param (LawBody t)), LawTest t) => t -> IO ()Source

Top level use of ClassLaws is often `quickLawCheck`

someLaw