Module

Data.Operator.PartialOrd

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

#PartialOrd1 Source

class PartialOrd1 f  where

The PartialOrd1 typeclass represents type constructors f that have an asociated partial ordering of values of type f a independent of any choice of a.

PartialOrd1 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

That is, partial orderings should satisfy all the laws of total orderings

  • Reflexivity: a .<= a
  • Antisymmetry: if a .<= b and b .<= a then a .== b
  • Transitivity: if a .<= b and b .<= c then a .<= c

... EXCEPT the law of connexity, which follows:

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

Members

Instances

#pBetween1 Source

pBetween1 :: forall f a. PartialOrd1 f => f a -> f a -> f a -> Maybe Boolean

#pClamp1 Source

pClamp1 :: forall f a. PartialOrd1 f => f a -> f a -> f a -> Maybe (f a)

#pComparing1 Source

pComparing1 :: forall f b a. PartialOrd1 f => (a -> f b) -> a -> a -> Maybe Ordering

#pGreaterThan1 Source

pGreaterThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean

#(.>?) Source

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

#pGreaterThanOrEq1 Source

pGreaterThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean

#(.>=?) Source

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

#pLessThan1 Source

pLessThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean

#(.<?) Source

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

#pLessThanOrEq1 Source

pLessThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean

#(.<=?) Source

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

#pMax1 Source

pMax1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe (f a)

#pMin1 Source

pMin1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe (f a)