logfloat-0.9.1: Log-domain floating point numbersSource codeContentsIndex
Portabilitysemi-portable (overlapping instances, etc)
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.
class PartialOrd a where
cmp :: a -> a -> Maybe Ordering
gt :: a -> a -> Maybe Bool
ge :: a -> a -> Maybe Bool
eq :: a -> a -> Maybe Bool
ne :: a -> a -> Maybe Bool
le :: a -> a -> Maybe Bool
lt :: a -> a -> Maybe Bool
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

cmp :: a -> a -> Maybe OrderingSource
gt :: a -> a -> Maybe BoolSource
ge :: a -> a -> Maybe BoolSource
eq :: a -> a -> Maybe BoolSource
ne :: a -> a -> Maybe BoolSource
le :: a -> a -> Maybe BoolSource
lt :: a -> a -> Maybe BoolSource
show/hide Instances
Produced by Haddock version 2.3.0