Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
Eq a => Eq (Contrarian a) |
newtype LuckySortOrder a Source
This newtype is perfect to transform any sorting algorithm into a lucky sort!
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
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.
Fiendish a |