Witchcraft.Ord.Proto protocol (Witchcraft v1.0.4) 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
Specs
t() :: term()
Link to this section Functions
Specs
compare(Witchcraft.Ord.t(), Witchcraft.Ord.t()) :: Witchcraft.Ord.ordering()
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