module Pandora.Pattern.Object.Chain (Chain (..)) where
import Pandora.Pattern.Object.Setoid (Setoid)
import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))
import Pandora.Paradigm.Primary.Object.Ordering (Ordering, order)
class Setoid a => Chain a where
{-# MINIMAL (<=>) #-}
(<=>) :: a -> a -> Ordering
(<) :: a -> a -> Boolean
x < y = order True False False (x <=> y)
(<=) :: a -> a -> Boolean
x <= y = order True True False (x <=> y)
(>) :: a -> a -> Boolean
x > y = order False False True (x <=> y)
(>=) :: a -> a -> Boolean
x >= y = order False True True (x <=> y)