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 wrap
ped values
seq
ing a wrap
ped function to a wrap
ped value is the same as wrapping the
result of the function on that value
seq
ing a lifted id
to some lifted value v
does not change v
The order does not matter when seq
ing to a wrap
ped value
and a wrap
ped 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 wrap
ped values
Examples
iex> spotcheck_functor([1,2,3], &(&1 * 10))
true
Specs
spotcheck_homomorphism(any, any, (... -> any)) :: boolean
seq
ing a wrap
ped function to a wrap
ped value is the same as wrapping the
result of the function on that value.
Examples
iex> spotcheck_homomorphism([], 1, &(&1 * 10))
true