Witchcraft v1.0.0-beta Witchcraft.Ord.Proto protocol View Source

Protocol for the Elixir.Witchcraft.Ord type class

For this type class’s API, please refer to Elixir.Witchcraft.Ord

Link to this section Summary

Functions

Get the ordering relationship between two elements

Link to this section Types

Link to this section Functions

Get the ordering relationship between two elements.

Possible results are :lesser, :equal, and :greater

Examples

iex> compare(1, 1)
:equal

iex> compare([1], [2])
:lesser

iex> compare([1, 2], [3])
:lesser

iex> compare([3, 2, 1], [1, 2, 3, 4, 5])
:greater