logfloat-0.12: Log-domain floating point numbers

Portabilitysemi-portable (overlapping instances, etc)
Stabilityexperimental
Maintainerwren@community.haskell.org

Data.Number.PartialOrd

Contents

Description

The Prelude's Ord class for dealing with ordered types is often onerous to use because it requires Eq as well as a total ordering. While such total orderings are common, partial orderings are moreso. This module presents a class for partially ordered types.

Synopsis

Partial Ordering

class PartialOrd a whereSource

This class defines a partially ordered type. The method names were chosen so as not to conflict with Ord and Eq. We use Maybe instead of defining new types PartialOrdering and FuzzyBool because this way should make the class easier to use.

Minimum complete definition: cmp

Methods

cmp :: a -> a -> Maybe OrderingSource

like compare

gt :: a -> a -> Maybe BoolSource

like (>)

ge :: a -> a -> Maybe BoolSource

like (>=)

eq :: a -> a -> Maybe BoolSource

like (==)

ne :: a -> a -> Maybe BoolSource

like (/=)

le :: a -> a -> Maybe BoolSource

like (<=)

lt :: a -> a -> Maybe BoolSource

like (<)

maxPO :: a -> a -> Maybe aSource

like max. The default instance returns the left argument when they're equal.

minPO :: a -> a -> Maybe aSource

like min. The default instance returns the left argument when they're equal.

Functions

comparingPO :: PartialOrd b => (a -> b) -> a -> a -> Maybe OrderingSource

Like Data.Ord.comparing. Helpful in conjunction with the xxxBy family of functions from Data.List