Witchcraft v0.5.0 Witchcraft.Monoid.Property
Check samples of your monoid to confirm that your data adheres to the monoidal properties. All members of your datatype should adhere to these rules. They are placed here as a quick way to spotcheck some of your values.
Summary
Functions
Spotcheck all monoid properties
Check that Monoid.append
is associative
(ie: brackets don’t matter)
Check that some member of your monoid combines with the identity to return itself
Functions
Specs
spotcheck(any, any, any) :: boolean
Spotcheck all monoid properties
iex> spotcheck(1,2,3)
true
Specs
spotcheck_associativity(any, any, any) :: boolean
Check that Monoid.append
is associative
(ie: brackets don’t matter)
iex> spotcheck_associativity("a", "b", "c")
true