abides-0.0.1: Simple boolean tests to see if a value abides by certain properties

Safe HaskellSafe
LanguageHaskell2010

Test.Abides.Properties

Synopsis

Documentation

reflexive :: Eq a => a -> Bool Source #

x == x?

commutative :: Eq b => (a -> a -> b) -> a -> a -> Bool Source #

f x y == f y x?

associative :: Eq a => (a -> a -> a) -> a -> a -> a -> Bool Source #

f (f x y) z == f x (f y z)?

idempotent :: Eq a => (a -> a) -> a -> Bool Source #

f (f x) == f x?

distributive :: Eq a => (a -> a) -> (a -> a -> a) -> a -> a -> Bool Source #

f (g x y) == g (f x) (f y)?

distributive' :: Eq b => (a -> b) -> (a -> a -> a) -> (b -> b -> b) -> a -> a -> Bool Source #

f (g x y) == g' (f x) (f y)?

constL :: Eq a => (a -> a -> a) -> a -> a -> Bool Source #

f x y == x? Note: bottom ~ forall y. f bottom y == bottom, while unit ~ forall x. f x unit == x

constR :: Eq a => (a -> a -> a) -> a -> a -> Bool Source #

f x y == y?