Witchcraft v1.0.0-beta Witchcraft.Category View Source
A category is some collection of objects and relationships (morphisms) between them.
This idea is captured by the idea of an identity function for objects,
and the ability to compose relationships between objects. In most cases,
these are very straightforward and composition and identity are the standard
functions from the Quark
package or similar.
Type Class
An instance of Witchcraft.Category
must also implement Witchcraft.Semigroupoid
,
and define Witchcraft.Category.identity/1
.
Semigroupoid [compose/2]
↓
Category [identity/1]
Link to this section Summary
Functions
Take some value and return it again
Link to this section Types
Link to this section Functions
Link to this function
identity(category)
View Source
identity(Witchcraft.Category.t) :: Witchcraft.Category.t
Take some value and return it again
Examples
iex> classic_id = identity(fn -> nil end)
...> classic_id.(42)
42