mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
17 lines
388 B
Elixir
17 lines
388 B
Elixir
|
unless Code.ensure_loaded?(Comparable) do
|
||
|
defprotocol Comparable do
|
||
|
@moduledoc """
|
||
|
Protocol which describes ordering relation for pair of types
|
||
|
"""
|
||
|
|
||
|
@type t :: Comparable.t()
|
||
|
@type ord :: :gt | :lt | :eq
|
||
|
|
||
|
@doc """
|
||
|
Accepts struct with fields :left and :right and returns ord value
|
||
|
"""
|
||
|
@spec compare(t) :: ord
|
||
|
def compare(left_and_right)
|
||
|
end
|
||
|
end
|