reord-0.0.0.2: Ad-hoc Ord instances

Data.Ord.ReOrd

Synopsis

Documentation

newtype Ord a => ReverseOrd a Source

A handy constructor which just reverses the sense of an existing Ord instance.

Constructors

ReverseOrd a 

Instances

Eq a => Eq (ReverseOrd a) 
Ord a => Ord (ReverseOrd a) 
(Ord a, Show a) => Show (ReverseOrd a) 

data ReOrd a Source

A type which provides an ad-hoc Ord instance for the type it wraps. It is the user's responsibility to make sure that it obeys all relevant laws, also taking into account the fact that when 2 items are compared, only one of their cmp functions is invoked (the left one)

Constructors

ReOrd 

Fields

cmp :: a -> a -> Ordering
 
item :: a
 

Instances

Eq (ReOrd a) 
Ord (ReOrd a)