acme-miscorder-0.1.0.0: Miscellaneous newtypes for orderings of discutable use.

Safe HaskellNone
LanguageHaskell98

Acme.MiscOrder

Description

This module contains a collection of orderings of dubious utility, inspired by this discussion on the haskell-cafe mailing-list.

Synopsis

Documentation

newtype Contrarian a Source

This newtype inverts the result of the (==) function.

Constructors

Contrarian a 

Instances

Eq a => Eq (Contrarian a) 

newtype LuckySortOrder a Source

This newtype is perfect to transform any sorting algorithm into a lucky sort!

Constructors

LuckySortOrder a 

Instances

Eq a => Eq (LuckySortOrder a) 
Ord a => Ord (LuckySortOrder a) 

newtype Perverse a Source

This newtype does respects the equality relation laws…by treating any two values as equal

Constructors

Perverse a 

Instances

Eq (Perverse a) 
Ord (Perverse a) 

newtype Fiendish a Source

This newtype gives a random result for any two inequal values. A warning though: given that I didn't manage to memoize a polymorphic function for use as a typeclass instance, its Ord instance can give different results on different calls with the same arguments.

Constructors

Fiendish a 

Instances

Eq a => Eq (Fiendish a) 
Eq a => Ord (Fiendish a) 
Show a => Show (Fiendish a)