Witchcraft.Comonad.Proto protocol (Witchcraft v1.0.4) View Source

Protocol for the Elixir.Witchcraft.Comonad type class

For this type class's API, please refer to Elixir.Witchcraft.Comonad

Link to this section Summary

Functions

Extract a value out of some context / data structure. This is the opposite of Witchcraft.Applicative.of/2.

Link to this section Types

Link to this section Functions

Specs

extract(Witchcraft.Comonad.t()) :: any()

Extract a value out of some context / data structure. This is the opposite of Witchcraft.Applicative.of/2.

Examples

iex> extract({1, 2})
2

extract(%Id{id: 42})
#=> 42