Safe Haskell | None |
---|---|
Language | Haskell98 |
Acme.MiscOrder
Description
This module contains a collection of orderings of dubious utility, inspired by this discussion on the haskell-cafe mailing-list.
- newtype Contrarian a = Contrarian a
- newtype LuckySortOrder a = LuckySortOrder a
- newtype Perverse a = Perverse a
- newtype Fiendish a = Fiendish a
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) |
This newtype does respects the equality relation laws…by treating any two values as equal
Constructors
Perverse a |
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 |