plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Internal.Ord

Synopsis

Documentation

class PEq t => POrd t where Source #

Total ordering relation.

Laws

#<= must form a total order. More precisely:

  1. x #<= x = pcon PTrue (reflexivity)
  2. (y #< x) #|| (z #< y) #|| (x #<= z) = pcon PTrue (transitivity)
  3. (x #<= y) #|| (y #<= x) = pcon PTrue (totality)

Furthermore, #< must be an equivalent strict total order to #<=:

  1. x #< x = pcon PFalse (irreflexivity)
  2. (y #<= x) #|| (z #<= y) #|| (x #< z) = pcon PTrue (transitivity)
  3. (x #< y) #|| (y #< x) #|| (x #== z) = pcon PTrue (trichotomy)
  4. x #<= y = (x #< y) #|| (x #== y) (strict equivalence)

If you define pmax or pmin, ensure the following also hold:

  1. pmax # x # y = pmax # y # x (commutativity, also for @pmin)
  2. pmax # x #$ pmax y z = pmax # (pmax # x # y) # z (associativity, also for @pmin)
  3. pmax # x #$ pmin # y # z = pmin # (pmax # x # y) # (pmax # x # z) (pmax distributes over pmin, also equivalent for pmin)
  4. pmin x y = pif' (x #<= y) x y
  5. pmax x y = pif' (x #<= y) y x

Laws 8-12 hold if you use the defaults provided by this type class.

@since WIP

Minimal complete definition

Nothing

Methods

(#<=) :: Term s t -> Term s t -> Term s PBool infix 4 Source #

@since WIP

default (#<=) :: POrd (PInner t) => Term s t -> Term s t -> Term s PBool Source #

(#<) :: Term s t -> Term s t -> Term s PBool infix 4 Source #

@since WIP

default (#<) :: POrd (PInner t) => Term s t -> Term s t -> Term s PBool Source #

pmax :: forall (s :: S). Term s t -> Term s t -> Term s t Source #

@since WIP

pmin :: forall (s :: S). Term s t -> Term s t -> Term s t Source #

@since WIP

Instances

Instances details
POrd PBitString Source #

@since WIP

Instance details

Defined in Plutarch.BitString

Methods

(#<=) :: forall (s :: S). Term s PBitString -> Term s PBitString -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PBitString -> Term s PBitString -> Term s PBool Source #

pmax :: forall (s :: S). Term s PBitString -> Term s PBitString -> Term s PBitString Source #

pmin :: forall (s :: S). Term s PBitString -> Term s PBitString -> Term s PBitString Source #

POrd PBool Source # 
Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

pmax :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

pmin :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

POrd PByte Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PBool Source #

pmax :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PByte Source #

pmin :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PByte Source #

POrd PByteString Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PBool Source #

pmax :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PByteString Source #

pmin :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PByteString Source #

POrd PEndianness Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PBool Source #

pmax :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PEndianness Source #

pmin :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PEndianness Source #

POrd PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.Ord

POrd PInteger Source # 
Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PBool Source #

pmax :: forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PInteger Source #

pmin :: forall (s :: S). Term s PInteger -> Term s PInteger -> Term s PInteger Source #

POrd PUnit Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PBool Source #

pmax :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PUnit Source #

pmin :: forall (s :: S). Term s PUnit -> Term s PUnit -> Term s PUnit Source #

POrd PPositive Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Numeric

Methods

(#<=) :: forall (s :: S). Term s PPositive -> Term s PPositive -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PPositive -> Term s PPositive -> Term s PBool Source #

pmax :: forall (s :: S). Term s PPositive -> Term s PPositive -> Term s PPositive Source #

pmin :: forall (s :: S). Term s PPositive -> Term s PPositive -> Term s PPositive Source #

POrd PRational Source # 
Instance details

Defined in Plutarch.Rational

Methods

(#<=) :: forall (s :: S). Term s PRational -> Term s PRational -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PRational -> Term s PRational -> Term s PBool Source #

pmax :: forall (s :: S). Term s PRational -> Term s PRational -> Term s PRational Source #

pmin :: forall (s :: S). Term s PRational -> Term s PRational -> Term s PRational Source #

(PIsData a, POrd a) => POrd (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

(#<=) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s (PDataNewtype a) Source #

pmin :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s (PDataNewtype a) Source #

(SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': (x' ': xs))) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

(#<=) :: forall (s :: S). Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) Source #

pmin :: forall (s :: S). Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) -> Term s (PDataRecord ((label ':= x) ': (x' ': xs))) Source #

(POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

(#<=) :: forall (s :: S). Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) Source #

pmin :: forall (s :: S). Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) -> Term s (PDataRecord '[label ':= x]) Source #

POrd (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

(#<=) :: forall (s :: S). Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) Source #

pmin :: forall (s :: S). Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) -> Term s (PDataRecord '[]) Source #

All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

(#<=) :: forall (s :: S). Term s (PDataSum defs) -> Term s (PDataSum defs) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataSum defs) -> Term s (PDataSum defs) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PDataSum defs) -> Term s (PDataSum defs) -> Term s (PDataSum defs) Source #

pmin :: forall (s :: S). Term s (PDataSum defs) -> Term s (PDataSum defs) -> Term s (PDataSum defs) Source #

(POrd a, POrd b, PIsData a, PIsData b) => POrd (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

(#<=) :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s PBool Source #

pmax :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s (PEitherData a b) Source #

pmin :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s (PEitherData a b) Source #

(#>) :: forall (a :: S -> Type) (s :: S). POrd a => Term s a -> Term s a -> Term s PBool infix 4 Source #

@since WIP

(#>=) :: forall (a :: S -> Type) (s :: S). POrd a => Term s a -> Term s a -> Term s PBool infix 4 Source #

@since WIP