View Source Witchcraft.Comonad.Proto protocol (Witchcraft v1.0.6-doma)

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

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

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

examples

Examples

iex> extract({1, 2})
2

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