numeric-prelude-0.4.3.1: An experimental alternative hierarchy of numeric type classes

Algebra.Indexable

Description

An alternative type class for Ord which allows an ordering for dictionaries like Data.Map and Data.Set independently from the ordering with respect to a magnitude.

Synopsis

# Documentation

class Eq a => C a where Source #

Definition of an alternative ordering of objects independent from a notion of magnitude. For an application see MathObj.PartialFraction.

Minimal complete definition

compare

Methods

compare :: a -> a -> Ordering Source #

Instances
 Source # Instance detailsDefined in Algebra.Indexable Methods Source # Instance detailsDefined in Number.Peano Methodscompare :: T -> T -> Ordering Source # C a => C [a] Source # Instance detailsDefined in Algebra.Indexable Methodscompare :: [a] -> [a] -> Ordering Source # (Ord a, C a) => C (T a) Source # Instance detailsDefined in Number.Ratio Methodscompare :: T a -> T a -> Ordering Source # (C a, C a) => C (T a) Source # Instance detailsDefined in MathObj.Polynomial Methodscompare :: T a -> T a -> Ordering Source # C a => C (T a) Source # Instance detailsDefined in Number.Complex Methodscompare :: T a -> T a -> Ordering Source # (C a, C b) => C (a, b) Source # Instance detailsDefined in Algebra.Indexable Methodscompare :: (a, b) -> (a, b) -> Ordering Source #

ordCompare :: Ord a => a -> a -> Ordering Source #

If the type has already an Ord instance it is certainly the most easiest to define compare to be equal to Ord's compare.

liftCompare :: C b => (a -> b) -> a -> a -> Ordering Source #

Lift compare implementation from a wrapped object.

data ToOrd a Source #

Wrap an indexable object such that it can be used in Data.Map and Data.Set.

Instances
 Eq a => Eq (ToOrd a) Source # Instance detailsDefined in Algebra.Indexable Methods(==) :: ToOrd a -> ToOrd a -> Bool #(/=) :: ToOrd a -> ToOrd a -> Bool # C a => Ord (ToOrd a) Source # Instance detailsDefined in Algebra.Indexable Methodscompare :: ToOrd a -> ToOrd a -> Ordering #(<) :: ToOrd a -> ToOrd a -> Bool #(<=) :: ToOrd a -> ToOrd a -> Bool #(>) :: ToOrd a -> ToOrd a -> Bool #(>=) :: ToOrd a -> ToOrd a -> Bool #max :: ToOrd a -> ToOrd a -> ToOrd a #min :: ToOrd a -> ToOrd a -> ToOrd a # Show a => Show (ToOrd a) Source # Instance detailsDefined in Algebra.Indexable MethodsshowsPrec :: Int -> ToOrd a -> ShowS #show :: ToOrd a -> String #showList :: [ToOrd a] -> ShowS #

toOrd :: a -> ToOrd a Source #

fromOrd :: ToOrd a -> a Source #