Witchcraft.Category (Witchcraft v1.0.4) View Source

A category is some collection of objects and relationships (morphisms) between them.

This idea is captured by the notion 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, apply/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

See Witchcraft.Category.identity/1.

Specs

identity(t()) :: t()

Take some value and return it again.

Examples

iex> classic_id = identity(fn -> nil end)
...> classic_id.(42)
42