Witchcraft v0.5.0 API Reference
Modules
Convenient top-level use
Applicative functors provide a method of seqing a function contained in a data structure to a value of the same type. This allows you to seq and compose functions to values while avoiding repeated manual wrapping and unwrapping of those values
Function helpers, derivatives and operators for
Witchcraft.Applicative.Protocol
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
Define a wrapping function to lift a value into your struct
Functors provide a way to apply a function to value(s) a datatype (lists, trees, maybes, etc)
Functions that come directly from lift
Operator aliases for Witchcraft.Operator
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
Because we are following the Functor -> Applicative -> Monad
hierarchy,
return
is already defined as pure
. bind
can be defined in terms of join
and lift
, so we only need to define join
for monads
Function helpers, derivatives and operators for Witchcraft.Monad
Operator aliases for Witchcraft.Monad
Properties to help ensure that your defimpl
is sane
Monoids are a set of elements, and a binary combining operation (op
) that
returns another member of the set
Get the identity without providing a sample value
Operator aliases for Witchcraft.Monoid
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
Breaking counterexample for testing