logfloat-0.13.3.2: Log-domain floating point numbers

CopyrightCopyright (c) 2007--2015 wren gayle romano
LicenseBSD3
Maintainerwren@community.haskell.org
Stabilitystable
Portabilitysemi-portable (OverlappingInstances,...)
Safe HaskellNone
LanguageHaskell98

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 more so. This module presents a class for partially ordered types.

Synopsis

Partial Ordering

class PartialOrd a where Source

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

Minimal complete definition

cmp

Methods

cmp :: a -> a -> Maybe Ordering Source

like compare

gt :: a -> a -> Maybe Bool infix 4 Source

like (>)

ge :: a -> a -> Maybe Bool infix 4 Source

like (>=)

eq :: a -> a -> Maybe Bool infix 4 Source

like (==)

ne :: a -> a -> Maybe Bool infix 4 Source

like (/=)

le :: a -> a -> Maybe Bool infix 4 Source

like (<=)

lt :: a -> a -> Maybe Bool infix 4 Source

like (<)

maxPO :: a -> a -> Maybe a infix 4 Source

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

minPO :: a -> a -> Maybe a infix 4 Source

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

Functions

comparingPO :: PartialOrd b => (a -> b) -> a -> a -> Maybe Ordering Source

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