Module

# Data.PartialOrd

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

### #PartialOrdSource

``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

• `pCompare :: a -> a -> Maybe Ordering`

#### Instances

• `(Ord a) => PartialOrd a`

### #pBetweenSource

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

### #pClampSource

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

### #pComparingSource

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

### #pGreaterThanSource

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

### #(>?)Source

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

### #pGreaterThanOrEqSource

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

### #(>=?)Source

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

### #pLessThanSource

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

### #(<?)Source

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

### #pLessThanOrEqSource

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

### #(<=?)Source

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

### #pMaxSource

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

### #pMinSource

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