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

spotcheck(context, f, g, typecheck)

Specs

spotcheck(any, (any -> any), (any -> any), (any -> boolean)) :: boolean

Spotcheck all functor properties

spotcheck_associates_object(context, func, typecheck)

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

spotcheck_preserve_compositon(context, f, g)

Specs

spotcheck_preserve_compositon(any, (any -> any), (any -> any)) :: boolean

Check that lifting a composed function is the same as lifting functions in sequence

spotcheck_preserve_identity(context, func)

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