Witchcraft v0.5.0 Witchcraft.Applicative.Property
Check samples of your applicative functor to confirm that your data adheres to the
applicative properties. All members of your datatype should adhere to these rules,
plus implement Witchcraft.Functor.
They are placed here as a quick way to spotcheck some of your values.
Summary
Functions
seq composes normally
Being an applicative functor, seq behaves as lift on wrapped values
seqing a wrapped function to a wrapped value is the same as wrapping the
result of the function on that value
seqing a lifted id to some lifted value v does not change v
The order does not matter when seqing to a wrapped value
and a wrapped function
Functions
Specs
spotcheck_composition(any, any, any) :: boolean
seq composes normally.
Examples
iex> spotcheck_composition([1, 2], [&(&1 * 2)], [&(&1 * 10)])
true
Specs
spotcheck_functor(any, (... -> any)) :: boolean
Being an applicative functor, seq behaves as lift on wrapped values
Examples
iex> spotcheck_functor([1,2,3], &(&1 * 10))
true
Specs
spotcheck_homomorphism(any, any, (... -> any)) :: boolean
seqing a wrapped function to a wrapped value is the same as wrapping the
result of the function on that value.
Examples
iex> spotcheck_homomorphism([], 1, &(&1 * 10))
true