Witchcraft v0.5.0 Witchcraft.Functor.Property
Check samples of your functor to confirm that your data adheres to the functor 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 functor properties
Check that lifting a function into some context returns a member of the target type
Check that lifting a composed function is the same as lifting functions in sequence
Check that lifting a function does not interfere with identity.
In other words, lifting id(a)
shoud be the same as the identity of lifting a
Functions
Specs
spotcheck(any, (any -> any), (any -> any), (any -> boolean)) :: boolean
Spotcheck all functor properties
Specs
spotcheck_associates_object(any, (any -> any), (any -> boolean)) :: boolean
Check that lifting a function into some context returns a member of the target type
Specs
spotcheck_preserve_compositon(any, (any -> any), (any -> any)) :: boolean
Check that lifting a composed function is the same as lifting functions in sequence
Specs
spotcheck_preserve_identity(any, (any -> any)) :: boolean
Check that lifting a function does not interfere with identity.
In other words, lifting id(a)
shoud be the same as the identity of lifting a
.
A ---- id ----> A
| |
(f) (f)
| |
v v
B ---- id ----> B