Realm v0.1.0 Realm.Category protocol 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 Realm.Category must also implement Realm.Semigroupoid, and define Realm.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

Link to this function

identity(category)

View Source
identity(t()) :: t()

Take some value and return it again.

Examples

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