Module

Data.PartialOrd

Package
purescript-higher-order
Repository
matthew-hilty/purescript-higher-order

#PartialOrd Source

class PartialOrd a  where

The PartialOrd typeclass registers types that support a partial order.

PartialOrd instances should satisfy the laws of partial orderings:

  • Reflexivity: a <=? a == Just true
  • Antisymmetry: if a <=? b == Just true and b <=? a == Just true then a == b
  • Transitivity: if a <=? b == Just true and b <=? c == Just true then a <=? c == Just true

Although partial orderings and total orderings have similar laws, unlike total orderings, partial orderings need not satisfy the law of connexity, which follows:

  • Connexity: a <= b or b <= a

Members

Instances

#pBetween Source

pBetween :: forall a. PartialOrd a => a -> a -> a -> Maybe Boolean

#pClamp Source

pClamp :: forall a. PartialOrd a => a -> a -> a -> Maybe a

#pComparing Source

pComparing :: forall b a. PartialOrd b => (a -> b) -> a -> a -> Maybe Ordering

#pGreaterThan Source

pGreaterThan :: forall a. PartialOrd a => a -> a -> Maybe Boolean

#(>?) Source

Operator alias for Data.PartialOrd.pGreaterThan (left-associative / precedence 4)

#pGreaterThanOrEq Source

pGreaterThanOrEq :: forall a. PartialOrd a => a -> a -> Maybe Boolean

#(>=?) Source

Operator alias for Data.PartialOrd.pGreaterThanOrEq (left-associative / precedence 4)

#pLessThan Source

pLessThan :: forall a. PartialOrd a => a -> a -> Maybe Boolean

#(<?) Source

Operator alias for Data.PartialOrd.pLessThan (left-associative / precedence 4)

#pLessThanOrEq Source

pLessThanOrEq :: forall a. PartialOrd a => a -> a -> Maybe Boolean

#(<=?) Source

Operator alias for Data.PartialOrd.pLessThanOrEq (left-associative / precedence 4)

#pMax Source

pMax :: forall a. PartialOrd a => a -> a -> Maybe a

#pMin Source

pMin :: forall a. PartialOrd a => a -> a -> Maybe a