mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
58065c31cd
It all compiles conditionally, so that if an explicit dependency exists on `comp` it will still be used
16 lines
388 B
Elixir
16 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
|