logfloat-0.13.4: Log-domain floating point numbers
CopyrightCopyright (c) 2007--2015 wren gayle romano
LicenseBSD3
Maintainerwren@community.haskell.org
Stabilitystable
Portabilitysemi-portable (OverlappingInstances,...)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Number.PartialOrd

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.

Instances

Instances details
PartialOrd Double Source # 
Instance details

Defined in Data.Number.PartialOrd

PartialOrd Float Source # 
Instance details

Defined in Data.Number.PartialOrd

Ord a => PartialOrd a Source # 
Instance details

Defined in Data.Number.PartialOrd

Methods

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

gt :: a -> a -> Maybe Bool Source #

ge :: a -> a -> Maybe Bool Source #

eq :: a -> a -> Maybe Bool Source #

ne :: a -> a -> Maybe Bool Source #

le :: a -> a -> Maybe Bool Source #

lt :: a -> a -> Maybe Bool Source #

maxPO :: a -> a -> Maybe a Source #

minPO :: a -> a -> Maybe a Source #

PartialOrd LogFloat Source # 
Instance details

Defined in Data.Number.LogFloat

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