base-4.16.1.0: Basic libraries

Data.Ord

Description

Orderings

Synopsis

Documentation

class Eq a => Ord a where Source #

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

Ord, as defined by the Haskell report, implements a total order and has the following properties:

Comparability
x <= y || y <= x = True
Transitivity
if x <= y && y <= z = True, then x <= z = True
Reflexivity
x <= x = True
Antisymmetry
if x <= y && y <= x = True, then x == y = True

The following operator interactions are expected to hold:

1. x >= y = y <= x
2. x < y = x <= y && x /= y
3. x > y = y < x
4. x < y = compare x y == LT
5. x > y = compare x y == GT
6. x == y = compare x y == EQ
7. min x y == if x <= y then x else y = True
8. max x y == if x >= y then x else y = True

Note that (7.) and (8.) do not require min and max to return either of their arguments. The result is merely required to equal one of the arguments in terms of (==).

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Minimal complete definition

Methods

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

(<) :: a -> a -> Bool infix 4 Source #

(<=) :: a -> a -> Bool infix 4 Source #

(>) :: a -> a -> Bool infix 4 Source #

(>=) :: a -> a -> Bool infix 4 Source #

max :: a -> a -> a Source #

min :: a -> a -> a Source #

Instances

Instances details
 # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(<) :: All -> All -> Bool Source #(<=) :: All -> All -> Bool Source #(>) :: All -> All -> Bool Source #(>=) :: All -> All -> Bool Source #max :: All -> All -> All Source #min :: All -> All -> All Source # # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(<) :: Any -> Any -> Bool Source #(<=) :: Any -> Any -> Bool Source #(>) :: Any -> Any -> Bool Source #(>=) :: Any -> Any -> Bool Source #max :: Any -> Any -> Any Source #min :: Any -> Any -> Any Source # # Instance detailsDefined in Data.Typeable.Internal Methods # Instance detailsDefined in Data.Unique Methods # Since: base-2.1 Instance detailsDefined in Data.Version Methods # Since: base-4.8.0.0 Instance detailsDefined in Data.Void Methods(<) :: Void -> Void -> Bool Source #(<=) :: Void -> Void -> Bool Source #(>) :: Void -> Void -> Bool Source #(>=) :: Void -> Void -> Bool Source #max :: Void -> Void -> Void Source #min :: Void -> Void -> Void Source # # Instance detailsDefined in Foreign.C.Types Methods(<) :: CBool -> CBool -> Bool Source #(>) :: CBool -> CBool -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods(<) :: CChar -> CChar -> Bool Source #(>) :: CChar -> CChar -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods(<) :: CInt -> CInt -> Bool Source #(<=) :: CInt -> CInt -> Bool Source #(>) :: CInt -> CInt -> Bool Source #(>=) :: CInt -> CInt -> Bool Source #max :: CInt -> CInt -> CInt Source #min :: CInt -> CInt -> CInt Source # # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods(<) :: CLong -> CLong -> Bool Source #(>) :: CLong -> CLong -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods(<) :: CSize -> CSize -> Bool Source #(>) :: CSize -> CSize -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods(<) :: CTime -> CTime -> Bool Source #(>) :: CTime -> CTime -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods(<) :: CUInt -> CUInt -> Bool Source #(>) :: CUInt -> CUInt -> Bool Source # # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.C.Types Methods # Instance detailsDefined in Foreign.Ptr Methods # Instance detailsDefined in Foreign.Ptr Methods # Since: base-4.11.0.0 Instance detailsDefined in GHC.ByteOrder Methods # Since: base-4.3.0.0 Instance detailsDefined in GHC.Conc.Sync Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.Conc.Sync Methods # Since: base-4.3.0.0 Instance detailsDefined in GHC.Conc.Sync Methods # Instance detailsDefined in GHC.Event.TimeOut Methods # Since: base-4.7.0.0 Instance detailsDefined in GHC.Exception Methods # Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods # Since: base-4.4.0.0 Instance detailsDefined in GHC.Fingerprint.Type Methods # Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods # Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Device Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Exception Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Exception Methods # Instance detailsDefined in GHC.IO.Exception Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Handle.Types Methods # Since: base-4.3.0.0 Instance detailsDefined in GHC.IO.Handle.Types Methods # Since: base-4.3.0.0 Instance detailsDefined in GHC.IO.Handle.Types Methods # Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.IOMode Methods # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(<) :: Int16 -> Int16 -> Bool Source #(>) :: Int16 -> Int16 -> Bool Source # # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(<) :: Int32 -> Int32 -> Bool Source #(>) :: Int32 -> Int32 -> Bool Source # # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(<) :: Int64 -> Int64 -> Bool Source #(>) :: Int64 -> Int64 -> Bool Source # # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(<) :: Int8 -> Int8 -> Bool Source #(<=) :: Int8 -> Int8 -> Bool Source #(>) :: Int8 -> Int8 -> Bool Source #(>=) :: Int8 -> Int8 -> Bool Source #max :: Int8 -> Int8 -> Int8 Source #min :: Int8 -> Int8 -> Int8 Source # # Instance detailsDefined in GHC.TypeLits Methods # Since: base-4.7.0.0 Instance detailsDefined in GHC.TypeLits Methods # Since: base-4.7.0.0 Instance detailsDefined in GHC.TypeNats Methods # Since: base-2.1 Instance detailsDefined in GHC.Unicode Methods # Since: base-2.1 Instance detailsDefined in GHC.Word Methods # Since: base-2.1 Instance detailsDefined in GHC.Word Methods # Since: base-2.1 Instance detailsDefined in GHC.Word Methods # Since: base-2.1 Instance detailsDefined in GHC.Word Methods(<) :: Word8 -> Word8 -> Bool Source #(>) :: Word8 -> Word8 -> Bool Source # # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods(<) :: CCc -> CCc -> Bool Source #(<=) :: CCc -> CCc -> Bool Source #(>) :: CCc -> CCc -> Bool Source #(>=) :: CCc -> CCc -> Bool Source #max :: CCc -> CCc -> CCc Source #min :: CCc -> CCc -> CCc Source # # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods(<) :: CDev -> CDev -> Bool Source #(<=) :: CDev -> CDev -> Bool Source #(>) :: CDev -> CDev -> Bool Source #(>=) :: CDev -> CDev -> Bool Source #max :: CDev -> CDev -> CDev Source #min :: CDev -> CDev -> CDev Source # # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods(<) :: CGid -> CGid -> Bool Source #(<=) :: CGid -> CGid -> Bool Source #(>) :: CGid -> CGid -> Bool Source #(>=) :: CGid -> CGid -> Bool Source #max :: CGid -> CGid -> CGid Source #min :: CGid -> CGid -> CGid Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CId -> CId -> Bool Source #(<=) :: CId -> CId -> Bool Source #(>) :: CId -> CId -> Bool Source #(>=) :: CId -> CId -> Bool Source #max :: CId -> CId -> CId Source #min :: CId -> CId -> CId Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CIno -> CIno -> Bool Source #(<=) :: CIno -> CIno -> Bool Source #(>) :: CIno -> CIno -> Bool Source #(>=) :: CIno -> CIno -> Bool Source #max :: CIno -> CIno -> CIno Source #min :: CIno -> CIno -> CIno Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CKey -> CKey -> Bool Source #(<=) :: CKey -> CKey -> Bool Source #(>) :: CKey -> CKey -> Bool Source #(>=) :: CKey -> CKey -> Bool Source #max :: CKey -> CKey -> CKey Source #min :: CKey -> CKey -> CKey Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CMode -> CMode -> Bool Source #(>) :: CMode -> CMode -> Bool Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CNfds -> CNfds -> Bool Source #(>) :: CNfds -> CNfds -> Bool Source # # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods(<) :: COff -> COff -> Bool Source #(<=) :: COff -> COff -> Bool Source #(>) :: COff -> COff -> Bool Source #(>=) :: COff -> COff -> Bool Source #max :: COff -> COff -> COff Source #min :: COff -> COff -> COff Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CPid -> CPid -> Bool Source #(<=) :: CPid -> CPid -> Bool Source #(>) :: CPid -> CPid -> Bool Source #(>=) :: CPid -> CPid -> Bool Source #max :: CPid -> CPid -> CPid Source #min :: CPid -> CPid -> CPid Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: CRLim -> CRLim -> Bool Source #(>) :: CRLim -> CRLim -> Bool Source # # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods # Instance detailsDefined in System.Posix.Types Methods(<) :: CUid -> CUid -> Bool Source #(<=) :: CUid -> CUid -> Bool Source #(>) :: CUid -> CUid -> Bool Source #(>=) :: CUid -> CUid -> Bool Source #max :: CUid -> CUid -> CUid Source #min :: CUid -> CUid -> CUid Source # # Instance detailsDefined in System.Posix.Types Methods(<) :: Fd -> Fd -> Bool Source #(<=) :: Fd -> Fd -> Bool Source #(>) :: Fd -> Fd -> Bool Source #(>=) :: Fd -> Fd -> Bool Source #max :: Fd -> Fd -> Fd Source #min :: Fd -> Fd -> Fd Source # Instance detailsDefined in GHC.Num.BigNat Methods Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods(<) :: TyCon -> TyCon -> Bool Source #(>) :: TyCon -> TyCon -> Bool Source # Instance detailsDefined in GHC.Num.Integer Methods Instance detailsDefined in GHC.Num.Natural Methods Ord () Instance detailsDefined in GHC.Classes Methodscompare :: () -> () -> Ordering Source #(<) :: () -> () -> Bool Source #(<=) :: () -> () -> Bool Source #(>) :: () -> () -> Bool Source #(>=) :: () -> () -> Bool Source #max :: () -> () -> () Source #min :: () -> () -> () Source # Instance detailsDefined in GHC.Classes Methods(<) :: Bool -> Bool -> Bool Source #(<=) :: Bool -> Bool -> Bool Source #(>) :: Bool -> Bool -> Bool Source #(>=) :: Bool -> Bool -> Bool Source #max :: Bool -> Bool -> Bool Source #min :: Bool -> Bool -> Bool Source # Instance detailsDefined in GHC.Classes Methods(<) :: Char -> Char -> Bool Source #(<=) :: Char -> Char -> Bool Source #(>) :: Char -> Char -> Bool Source #(>=) :: Char -> Char -> Bool Source #max :: Char -> Char -> Char Source #min :: Char -> Char -> Char Source # Note that due to the presence of NaN, Double's Ord instance does not satisfy reflexivity.>>> 0/0 <= (0/0 :: Double) False Also note that, due to the same, Ord's operator interactions are not respected by Double's instance:>>> (0/0 :: Double) > 1 False >>> compare (0/0 :: Double) 1 GT  Instance detailsDefined in GHC.Classes Methods Note that due to the presence of NaN, Float's Ord instance does not satisfy reflexivity.>>> 0/0 <= (0/0 :: Float) False Also note that, due to the same, Ord's operator interactions are not respected by Float's instance:>>> (0/0 :: Float) > 1 False >>> compare (0/0 :: Float) 1 GT  Instance detailsDefined in GHC.Classes Methods(<) :: Float -> Float -> Bool Source #(>) :: Float -> Float -> Bool Source # Instance detailsDefined in GHC.Classes Methods(<) :: Int -> Int -> Bool Source #(<=) :: Int -> Int -> Bool Source #(>) :: Int -> Int -> Bool Source #(>=) :: Int -> Int -> Bool Source #max :: Int -> Int -> Int Source #min :: Int -> Int -> Int Source # Instance detailsDefined in GHC.Classes Methods(<) :: Word -> Word -> Bool Source #(<=) :: Word -> Word -> Bool Source #(>) :: Word -> Word -> Bool Source #(>=) :: Word -> Word -> Bool Source #max :: Word -> Word -> Word Source #min :: Word -> Word -> Word Source # Ord a => Ord (ZipList a) # Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methodscompare :: ZipList a -> ZipList a -> Ordering Source #(<) :: ZipList a -> ZipList a -> Bool Source #(<=) :: ZipList a -> ZipList a -> Bool Source #(>) :: ZipList a -> ZipList a -> Bool Source #(>=) :: ZipList a -> ZipList a -> Bool Source #max :: ZipList a -> ZipList a -> ZipList a Source #min :: ZipList a -> ZipList a -> ZipList a Source # Ord a => Ord (Identity a) # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methodscompare :: Identity a -> Identity a -> Ordering Source #(<) :: Identity a -> Identity a -> Bool Source #(<=) :: Identity a -> Identity a -> Bool Source #(>) :: Identity a -> Identity a -> Bool Source #(>=) :: Identity a -> Identity a -> Bool Source #max :: Identity a -> Identity a -> Identity a Source #min :: Identity a -> Identity a -> Identity a Source # Ord a => Ord (First a) # Since: base-2.1 Instance detailsDefined in Data.Monoid Methodscompare :: First a -> First a -> Ordering Source #(<) :: First a -> First a -> Bool Source #(<=) :: First a -> First a -> Bool Source #(>) :: First a -> First a -> Bool Source #(>=) :: First a -> First a -> Bool Source #max :: First a -> First a -> First a Source #min :: First a -> First a -> First a Source # Ord a => Ord (Last a) # Since: base-2.1 Instance detailsDefined in Data.Monoid Methodscompare :: Last a -> Last a -> Ordering Source #(<) :: Last a -> Last a -> Bool Source #(<=) :: Last a -> Last a -> Bool Source #(>) :: Last a -> Last a -> Bool Source #(>=) :: Last a -> Last a -> Bool Source #max :: Last a -> Last a -> Last a Source #min :: Last a -> Last a -> Last a Source # Ord a => Ord (Down a) # Since: base-4.6.0.0 Instance detailsDefined in Data.Ord Methodscompare :: Down a -> Down a -> Ordering Source #(<) :: Down a -> Down a -> Bool Source #(<=) :: Down a -> Down a -> Bool Source #(>) :: Down a -> Down a -> Bool Source #(>=) :: Down a -> Down a -> Bool Source #max :: Down a -> Down a -> Down a Source #min :: Down a -> Down a -> Down a Source # Ord a => Ord (First a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: First a -> First a -> Ordering Source #(<) :: First a -> First a -> Bool Source #(<=) :: First a -> First a -> Bool Source #(>) :: First a -> First a -> Bool Source #(>=) :: First a -> First a -> Bool Source #max :: First a -> First a -> First a Source #min :: First a -> First a -> First a Source # Ord a => Ord (Last a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Last a -> Last a -> Ordering Source #(<) :: Last a -> Last a -> Bool Source #(<=) :: Last a -> Last a -> Bool Source #(>) :: Last a -> Last a -> Bool Source #(>=) :: Last a -> Last a -> Bool Source #max :: Last a -> Last a -> Last a Source #min :: Last a -> Last a -> Last a Source # Ord a => Ord (Max a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Max a -> Max a -> Ordering Source #(<) :: Max a -> Max a -> Bool Source #(<=) :: Max a -> Max a -> Bool Source #(>) :: Max a -> Max a -> Bool Source #(>=) :: Max a -> Max a -> Bool Source #max :: Max a -> Max a -> Max a Source #min :: Max a -> Max a -> Max a Source # Ord a => Ord (Min a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Min a -> Min a -> Ordering Source #(<) :: Min a -> Min a -> Bool Source #(<=) :: Min a -> Min a -> Bool Source #(>) :: Min a -> Min a -> Bool Source #(>=) :: Min a -> Min a -> Bool Source #max :: Min a -> Min a -> Min a Source #min :: Min a -> Min a -> Min a Source # Ord m => Ord (WrappedMonoid m) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #(>) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # Ord a => Ord (Dual a) # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Dual a -> Dual a -> Ordering Source #(<) :: Dual a -> Dual a -> Bool Source #(<=) :: Dual a -> Dual a -> Bool Source #(>) :: Dual a -> Dual a -> Bool Source #(>=) :: Dual a -> Dual a -> Bool Source #max :: Dual a -> Dual a -> Dual a Source #min :: Dual a -> Dual a -> Dual a Source # Ord a => Ord (Product a) # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Product a -> Product a -> Ordering Source #(<) :: Product a -> Product a -> Bool Source #(<=) :: Product a -> Product a -> Bool Source #(>) :: Product a -> Product a -> Bool Source #(>=) :: Product a -> Product a -> Bool Source #max :: Product a -> Product a -> Product a Source #min :: Product a -> Product a -> Product a Source # Ord a => Ord (Sum a) # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Sum a -> Sum a -> Ordering Source #(<) :: Sum a -> Sum a -> Bool Source #(<=) :: Sum a -> Sum a -> Bool Source #(>) :: Sum a -> Sum a -> Bool Source #(>=) :: Sum a -> Sum a -> Bool Source #max :: Sum a -> Sum a -> Sum a Source #min :: Sum a -> Sum a -> Sum a Source # # Since: base-2.1 Instance detailsDefined in GHC.ForeignPtr Methods(<) :: ForeignPtr a -> ForeignPtr a -> Bool Source #(<=) :: ForeignPtr a -> ForeignPtr a -> Bool Source #(>) :: ForeignPtr a -> ForeignPtr a -> Bool Source #(>=) :: ForeignPtr a -> ForeignPtr a -> Bool Source #max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source #min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source # Ord p => Ord (Par1 p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: Par1 p -> Par1 p -> Ordering Source #(<) :: Par1 p -> Par1 p -> Bool Source #(<=) :: Par1 p -> Par1 p -> Bool Source #(>) :: Par1 p -> Par1 p -> Bool Source #(>=) :: Par1 p -> Par1 p -> Bool Source #max :: Par1 p -> Par1 p -> Par1 p Source #min :: Par1 p -> Par1 p -> Par1 p Source # Ord (FunPtr a) # Instance detailsDefined in GHC.Ptr Methodscompare :: FunPtr a -> FunPtr a -> Ordering Source #(<) :: FunPtr a -> FunPtr a -> Bool Source #(<=) :: FunPtr a -> FunPtr a -> Bool Source #(>) :: FunPtr a -> FunPtr a -> Bool Source #(>=) :: FunPtr a -> FunPtr a -> Bool Source #max :: FunPtr a -> FunPtr a -> FunPtr a Source #min :: FunPtr a -> FunPtr a -> FunPtr a Source # Ord (Ptr a) # Since: base-2.1 Instance detailsDefined in GHC.Ptr Methodscompare :: Ptr a -> Ptr a -> Ordering Source #(<) :: Ptr a -> Ptr a -> Bool Source #(<=) :: Ptr a -> Ptr a -> Bool Source #(>) :: Ptr a -> Ptr a -> Bool Source #(>=) :: Ptr a -> Ptr a -> Bool Source #max :: Ptr a -> Ptr a -> Ptr a Source #min :: Ptr a -> Ptr a -> Ptr a Source # Integral a => Ord (Ratio a) # Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodscompare :: Ratio a -> Ratio a -> Ordering Source #(<) :: Ratio a -> Ratio a -> Bool Source #(<=) :: Ratio a -> Ratio a -> Bool Source #(>) :: Ratio a -> Ratio a -> Bool Source #(>=) :: Ratio a -> Ratio a -> Bool Source #max :: Ratio a -> Ratio a -> Ratio a Source #min :: Ratio a -> Ratio a -> Ratio a Source # Ord a => Ord (NonEmpty a) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodscompare :: NonEmpty a -> NonEmpty a -> Ordering Source #(<) :: NonEmpty a -> NonEmpty a -> Bool Source #(<=) :: NonEmpty a -> NonEmpty a -> Bool Source #(>) :: NonEmpty a -> NonEmpty a -> Bool Source #(>=) :: NonEmpty a -> NonEmpty a -> Bool Source #max :: NonEmpty a -> NonEmpty a -> NonEmpty a Source #min :: NonEmpty a -> NonEmpty a -> NonEmpty a Source # Ord a => Ord (Maybe a) # Since: base-2.1 Instance detailsDefined in GHC.Maybe Methodscompare :: Maybe a -> Maybe a -> Ordering Source #(<) :: Maybe a -> Maybe a -> Bool Source #(<=) :: Maybe a -> Maybe a -> Bool Source #(>) :: Maybe a -> Maybe a -> Bool Source #(>=) :: Maybe a -> Maybe a -> Bool Source #max :: Maybe a -> Maybe a -> Maybe a Source #min :: Maybe a -> Maybe a -> Maybe a Source # Ord a => Ord (a) Instance detailsDefined in GHC.Classes Methodscompare :: (a) -> (a) -> Ordering Source #(<) :: (a) -> (a) -> Bool Source #(<=) :: (a) -> (a) -> Bool Source #(>) :: (a) -> (a) -> Bool Source #(>=) :: (a) -> (a) -> Bool Source #max :: (a) -> (a) -> (a) Source #min :: (a) -> (a) -> (a) Source # Ord a => Ord [a] Instance detailsDefined in GHC.Classes Methodscompare :: [a] -> [a] -> Ordering Source #(<) :: [a] -> [a] -> Bool Source #(<=) :: [a] -> [a] -> Bool Source #(>) :: [a] -> [a] -> Bool Source #(>=) :: [a] -> [a] -> Bool Source #max :: [a] -> [a] -> [a] Source #min :: [a] -> [a] -> [a] Source # (Ord a, Ord b) => Ord (Either a b) # Since: base-2.1 Instance detailsDefined in Data.Either Methodscompare :: Either a b -> Either a b -> Ordering Source #(<) :: Either a b -> Either a b -> Bool Source #(<=) :: Either a b -> Either a b -> Bool Source #(>) :: Either a b -> Either a b -> Bool Source #(>=) :: Either a b -> Either a b -> Bool Source #max :: Either a b -> Either a b -> Either a b Source #min :: Either a b -> Either a b -> Either a b Source # Ord (Fixed a) # Since: base-2.1 Instance detailsDefined in Data.Fixed Methodscompare :: Fixed a -> Fixed a -> Ordering Source #(<) :: Fixed a -> Fixed a -> Bool Source #(<=) :: Fixed a -> Fixed a -> Bool Source #(>) :: Fixed a -> Fixed a -> Bool Source #(>=) :: Fixed a -> Fixed a -> Bool Source #max :: Fixed a -> Fixed a -> Fixed a Source #min :: Fixed a -> Fixed a -> Fixed a Source # Ord (Proxy s) # Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodscompare :: Proxy s -> Proxy s -> Ordering Source #(<) :: Proxy s -> Proxy s -> Bool Source #(<=) :: Proxy s -> Proxy s -> Bool Source #(>) :: Proxy s -> Proxy s -> Bool Source #(>=) :: Proxy s -> Proxy s -> Bool Source #max :: Proxy s -> Proxy s -> Proxy s Source #min :: Proxy s -> Proxy s -> Proxy s Source # Ord a => Ord (Arg a b) # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Arg a b -> Arg a b -> Ordering Source #(<) :: Arg a b -> Arg a b -> Bool Source #(<=) :: Arg a b -> Arg a b -> Bool Source #(>) :: Arg a b -> Arg a b -> Bool Source #(>=) :: Arg a b -> Arg a b -> Bool Source #max :: Arg a b -> Arg a b -> Arg a b Source #min :: Arg a b -> Arg a b -> Arg a b Source # Ord (TypeRep a) # Since: base-4.4.0.0 Instance detailsDefined in Data.Typeable.Internal Methodscompare :: TypeRep a -> TypeRep a -> Ordering Source #(<) :: TypeRep a -> TypeRep a -> Bool Source #(<=) :: TypeRep a -> TypeRep a -> Bool Source #(>) :: TypeRep a -> TypeRep a -> Bool Source #(>=) :: TypeRep a -> TypeRep a -> Bool Source #max :: TypeRep a -> TypeRep a -> TypeRep a Source #min :: TypeRep a -> TypeRep a -> TypeRep a Source # (Ix i, Ord e) => Ord (Array i e) # Since: base-2.1 Instance detailsDefined in GHC.Arr Methodscompare :: Array i e -> Array i e -> Ordering Source #(<) :: Array i e -> Array i e -> Bool Source #(<=) :: Array i e -> Array i e -> Bool Source #(>) :: Array i e -> Array i e -> Bool Source #(>=) :: Array i e -> Array i e -> Bool Source #max :: Array i e -> Array i e -> Array i e Source #min :: Array i e -> Array i e -> Array i e Source # Ord (U1 p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: U1 p -> U1 p -> Ordering Source #(<) :: U1 p -> U1 p -> Bool Source #(<=) :: U1 p -> U1 p -> Bool Source #(>) :: U1 p -> U1 p -> Bool Source #(>=) :: U1 p -> U1 p -> Bool Source #max :: U1 p -> U1 p -> U1 p Source #min :: U1 p -> U1 p -> U1 p Source # Ord (V1 p) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: V1 p -> V1 p -> Ordering Source #(<) :: V1 p -> V1 p -> Bool Source #(<=) :: V1 p -> V1 p -> Bool Source #(>) :: V1 p -> V1 p -> Bool Source #(>=) :: V1 p -> V1 p -> Bool Source #max :: V1 p -> V1 p -> V1 p Source #min :: V1 p -> V1 p -> V1 p Source # (Ord a, Ord b) => Ord (a, b) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b) -> (a, b) -> Ordering Source #(<) :: (a, b) -> (a, b) -> Bool Source #(<=) :: (a, b) -> (a, b) -> Bool Source #(>) :: (a, b) -> (a, b) -> Bool Source #(>=) :: (a, b) -> (a, b) -> Bool Source #max :: (a, b) -> (a, b) -> (a, b) Source #min :: (a, b) -> (a, b) -> (a, b) Source # Ord a => Ord (Const a b) # Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodscompare :: Const a b -> Const a b -> Ordering Source #(<) :: Const a b -> Const a b -> Bool Source #(<=) :: Const a b -> Const a b -> Bool Source #(>) :: Const a b -> Const a b -> Bool Source #(>=) :: Const a b -> Const a b -> Bool Source #max :: Const a b -> Const a b -> Const a b Source #min :: Const a b -> Const a b -> Const a b Source # Ord (f a) => Ord (Ap f a) # Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodscompare :: Ap f a -> Ap f a -> Ordering Source #(<) :: Ap f a -> Ap f a -> Bool Source #(<=) :: Ap f a -> Ap f a -> Bool Source #(>) :: Ap f a -> Ap f a -> Bool Source #(>=) :: Ap f a -> Ap f a -> Bool Source #max :: Ap f a -> Ap f a -> Ap f a Source #min :: Ap f a -> Ap f a -> Ap f a Source # Ord (f a) => Ord (Alt f a) # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Alt f a -> Alt f a -> Ordering Source #(<) :: Alt f a -> Alt f a -> Bool Source #(<=) :: Alt f a -> Alt f a -> Bool Source #(>) :: Alt f a -> Alt f a -> Bool Source #(>=) :: Alt f a -> Alt f a -> Bool Source #max :: Alt f a -> Alt f a -> Alt f a Source #min :: Alt f a -> Alt f a -> Alt f a Source # Ord (Coercion a b) # Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Coercion Methodscompare :: Coercion a b -> Coercion a b -> Ordering Source #(<) :: Coercion a b -> Coercion a b -> Bool Source #(<=) :: Coercion a b -> Coercion a b -> Bool Source #(>) :: Coercion a b -> Coercion a b -> Bool Source #(>=) :: Coercion a b -> Coercion a b -> Bool Source #max :: Coercion a b -> Coercion a b -> Coercion a b Source #min :: Coercion a b -> Coercion a b -> Coercion a b Source # Ord (a :~: b) # Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality Methodscompare :: (a :~: b) -> (a :~: b) -> Ordering Source #(<) :: (a :~: b) -> (a :~: b) -> Bool Source #(<=) :: (a :~: b) -> (a :~: b) -> Bool Source #(>) :: (a :~: b) -> (a :~: b) -> Bool Source #(>=) :: (a :~: b) -> (a :~: b) -> Bool Source #max :: (a :~: b) -> (a :~: b) -> a :~: b Source #min :: (a :~: b) -> (a :~: b) -> a :~: b Source # Ord (f p) => Ord (Rec1 f p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: Rec1 f p -> Rec1 f p -> Ordering Source #(<) :: Rec1 f p -> Rec1 f p -> Bool Source #(<=) :: Rec1 f p -> Rec1 f p -> Bool Source #(>) :: Rec1 f p -> Rec1 f p -> Bool Source #(>=) :: Rec1 f p -> Rec1 f p -> Bool Source #max :: Rec1 f p -> Rec1 f p -> Rec1 f p Source #min :: Rec1 f p -> Rec1 f p -> Rec1 f p Source # Ord (URec (Ptr ()) p) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering Source #(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source #min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source # Ord (URec Char p) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: URec Char p -> URec Char p -> Ordering Source #(<) :: URec Char p -> URec Char p -> Bool Source #(<=) :: URec Char p -> URec Char p -> Bool Source #(>) :: URec Char p -> URec Char p -> Bool Source #(>=) :: URec Char p -> URec Char p -> Bool Source #max :: URec Char p -> URec Char p -> URec Char p Source #min :: URec Char p -> URec Char p -> URec Char p Source # # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(<) :: URec Double p -> URec Double p -> Bool Source #(<=) :: URec Double p -> URec Double p -> Bool Source #(>) :: URec Double p -> URec Double p -> Bool Source #(>=) :: URec Double p -> URec Double p -> Bool Source #max :: URec Double p -> URec Double p -> URec Double p Source #min :: URec Double p -> URec Double p -> URec Double p Source # Ord (URec Float p) # Instance detailsDefined in GHC.Generics Methodscompare :: URec Float p -> URec Float p -> Ordering Source #(<) :: URec Float p -> URec Float p -> Bool Source #(<=) :: URec Float p -> URec Float p -> Bool Source #(>) :: URec Float p -> URec Float p -> Bool Source #(>=) :: URec Float p -> URec Float p -> Bool Source #max :: URec Float p -> URec Float p -> URec Float p Source #min :: URec Float p -> URec Float p -> URec Float p Source # Ord (URec Int p) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: URec Int p -> URec Int p -> Ordering Source #(<) :: URec Int p -> URec Int p -> Bool Source #(<=) :: URec Int p -> URec Int p -> Bool Source #(>) :: URec Int p -> URec Int p -> Bool Source #(>=) :: URec Int p -> URec Int p -> Bool Source #max :: URec Int p -> URec Int p -> URec Int p Source #min :: URec Int p -> URec Int p -> URec Int p Source # Ord (URec Word p) # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: URec Word p -> URec Word p -> Ordering Source #(<) :: URec Word p -> URec Word p -> Bool Source #(<=) :: URec Word p -> URec Word p -> Bool Source #(>) :: URec Word p -> URec Word p -> Bool Source #(>=) :: URec Word p -> URec Word p -> Bool Source #max :: URec Word p -> URec Word p -> URec Word p Source #min :: URec Word p -> URec Word p -> URec Word p Source # (Ord a, Ord b, Ord c) => Ord (a, b, c) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c) -> (a, b, c) -> Ordering Source #(<) :: (a, b, c) -> (a, b, c) -> Bool Source #(<=) :: (a, b, c) -> (a, b, c) -> Bool Source #(>) :: (a, b, c) -> (a, b, c) -> Bool Source #(>=) :: (a, b, c) -> (a, b, c) -> Bool Source #max :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #min :: (a, b, c) -> (a, b, c) -> (a, b, c) Source # (Ord1 f, Ord1 g, Ord a) => Ord (Product f g a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methodscompare :: Product f g a -> Product f g a -> Ordering Source #(<) :: Product f g a -> Product f g a -> Bool Source #(<=) :: Product f g a -> Product f g a -> Bool Source #(>) :: Product f g a -> Product f g a -> Bool Source #(>=) :: Product f g a -> Product f g a -> Bool Source #max :: Product f g a -> Product f g a -> Product f g a Source #min :: Product f g a -> Product f g a -> Product f g a Source # (Ord1 f, Ord1 g, Ord a) => Ord (Sum f g a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Sum Methodscompare :: Sum f g a -> Sum f g a -> Ordering Source #(<) :: Sum f g a -> Sum f g a -> Bool Source #(<=) :: Sum f g a -> Sum f g a -> Bool Source #(>) :: Sum f g a -> Sum f g a -> Bool Source #(>=) :: Sum f g a -> Sum f g a -> Bool Source #max :: Sum f g a -> Sum f g a -> Sum f g a Source #min :: Sum f g a -> Sum f g a -> Sum f g a Source # Ord (a :~~: b) # Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality Methodscompare :: (a :~~: b) -> (a :~~: b) -> Ordering Source #(<) :: (a :~~: b) -> (a :~~: b) -> Bool Source #(<=) :: (a :~~: b) -> (a :~~: b) -> Bool Source #(>) :: (a :~~: b) -> (a :~~: b) -> Bool Source #(>=) :: (a :~~: b) -> (a :~~: b) -> Bool Source #max :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source #min :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source # (Ord (f p), Ord (g p)) => Ord ((f :*: g) p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: (f :*: g) p -> (f :*: g) p -> Ordering Source #(<) :: (f :*: g) p -> (f :*: g) p -> Bool Source #(<=) :: (f :*: g) p -> (f :*: g) p -> Bool Source #(>) :: (f :*: g) p -> (f :*: g) p -> Bool Source #(>=) :: (f :*: g) p -> (f :*: g) p -> Bool Source #max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source # (Ord (f p), Ord (g p)) => Ord ((f :+: g) p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: (f :+: g) p -> (f :+: g) p -> Ordering Source #(<) :: (f :+: g) p -> (f :+: g) p -> Bool Source #(<=) :: (f :+: g) p -> (f :+: g) p -> Bool Source #(>) :: (f :+: g) p -> (f :+: g) p -> Bool Source #(>=) :: (f :+: g) p -> (f :+: g) p -> Bool Source #max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source #min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source # Ord c => Ord (K1 i c p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: K1 i c p -> K1 i c p -> Ordering Source #(<) :: K1 i c p -> K1 i c p -> Bool Source #(<=) :: K1 i c p -> K1 i c p -> Bool Source #(>) :: K1 i c p -> K1 i c p -> Bool Source #(>=) :: K1 i c p -> K1 i c p -> Bool Source #max :: K1 i c p -> K1 i c p -> K1 i c p Source #min :: K1 i c p -> K1 i c p -> K1 i c p Source # (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d) -> (a, b, c, d) -> Ordering Source #(<) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #(<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #(>) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #(>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source # (Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) # Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Compose Methodscompare :: Compose f g a -> Compose f g a -> Ordering Source #(<) :: Compose f g a -> Compose f g a -> Bool Source #(<=) :: Compose f g a -> Compose f g a -> Bool Source #(>) :: Compose f g a -> Compose f g a -> Bool Source #(>=) :: Compose f g a -> Compose f g a -> Bool Source #max :: Compose f g a -> Compose f g a -> Compose f g a Source #min :: Compose f g a -> Compose f g a -> Compose f g a Source # Ord (f (g p)) => Ord ((f :.: g) p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: (f :.: g) p -> (f :.: g) p -> Ordering Source #(<) :: (f :.: g) p -> (f :.: g) p -> Bool Source #(<=) :: (f :.: g) p -> (f :.: g) p -> Bool Source #(>) :: (f :.: g) p -> (f :.: g) p -> Bool Source #(>=) :: (f :.: g) p -> (f :.: g) p -> Bool Source #max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source # Ord (f p) => Ord (M1 i c f p) # Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: M1 i c f p -> M1 i c f p -> Ordering Source #(<) :: M1 i c f p -> M1 i c f p -> Bool Source #(<=) :: M1 i c f p -> M1 i c f p -> Bool Source #(>) :: M1 i c f p -> M1 i c f p -> Bool Source #(>=) :: M1 i c f p -> M1 i c f p -> Bool Source #max :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #min :: M1 i c f p -> M1 i c f p -> M1 i c f p Source # (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering Source #(<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #(<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #(>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #(>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering Source #(<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #(>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #(>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering Source #(<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #(>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #(>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) Source #min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) Source #min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) Source #min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) Source #min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering Source #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

data Ordering Source #

Constructors

 LT EQ GT

Instances

Instances details
 # Since: base-4.0.0.0 Instance detailsDefined in Data.Data Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering Source #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering Source #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) Source #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) Source #gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering Source #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] Source #gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u Source #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source # # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmconcat :: [Ordering] -> Ordering Source # # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsstimes :: Integral b => b -> Ordering -> Ordering Source # # Since: base-2.1 Instance detailsDefined in GHC.Enum Methods # Since: base-2.1 Instance detailsDefined in GHC.Enum Methods # Instance detailsDefined in GHC.Generics Associated Typestype Rep Ordering :: Type -> Type Source # Methods # Since: base-2.1 Instance detailsDefined in GHC.Ix Methodsrange :: (Ordering, Ordering) -> [Ordering] Source #index :: (Ordering, Ordering) -> Ordering -> Int Source #inRange :: (Ordering, Ordering) -> Ordering -> Bool Source #rangeSize :: (Ordering, Ordering) -> Int Source # # Since: base-2.1 Instance detailsDefined in GHC.Read Methods # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Ordering] -> ShowS Source # Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods type Rep Ordering # Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics type Rep Ordering = D1 ('MetaData "Ordering" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "LT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EQ" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GT" 'PrefixI 'False) (U1 :: Type -> Type)))

newtype Down a Source #

The Down type allows you to reverse sort order conveniently. A value of type Down a contains a value of type a (represented as Down a).

If a has an Ord instance associated with it then comparing two values thus wrapped will give you the opposite of their normal sort order. This is particularly useful when sorting in generalised list comprehensions, as in: then sortWith by Down x.

>>> compare True False
GT

>>> compare (Down True) (Down False)
LT


If a has a Bounded instance then the wrapped instance also respects the reversed ordering by exchanging the values of minBound and maxBound.

>>> minBound :: Int
-9223372036854775808

>>> minBound :: Down Int
Down 9223372036854775807


All other instances of Down a behave as they do for a.

Since: base-4.6.0.0

Constructors

 Down FieldsgetDown :: aSince: base-4.14.0.0

Instances

Instances details
 # Since: base-4.12.0.0 Instance detailsDefined in Control.Monad.Fix Methodsmfix :: (a -> Down a) -> Down a Source # # Since: base-4.12.0.0 Instance detailsDefined in Control.Monad.Zip Methodsmzip :: Down a -> Down b -> Down (a, b) Source #mzipWith :: (a -> b -> c) -> Down a -> Down b -> Down c Source #munzip :: Down (a, b) -> (Down a, Down b) Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => Down m -> m Source #foldMap :: Monoid m => (a -> m) -> Down a -> m Source #foldMap' :: Monoid m => (a -> m) -> Down a -> m Source #foldr :: (a -> b -> b) -> b -> Down a -> b Source #foldr' :: (a -> b -> b) -> b -> Down a -> b Source #foldl :: (b -> a -> b) -> b -> Down a -> b Source #foldl' :: (b -> a -> b) -> b -> Down a -> b Source #foldr1 :: (a -> a -> a) -> Down a -> a Source #foldl1 :: (a -> a -> a) -> Down a -> a Source #toList :: Down a -> [a] Source #null :: Down a -> Bool Source #length :: Down a -> Int Source #elem :: Eq a => a -> Down a -> Bool Source #maximum :: Ord a => Down a -> a Source #minimum :: Ord a => Down a -> a Source #sum :: Num a => Down a -> a Source #product :: Num a => Down a -> a Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Functor.Classes MethodsliftEq :: (a -> b -> Bool) -> Down a -> Down b -> Bool Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Functor.Classes MethodsliftCompare :: (a -> b -> Ordering) -> Down a -> Down b -> Ordering Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Functor.Classes MethodsliftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Down a) Source #liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Down a] Source #liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Down a) Source #liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Down a] Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Functor.Classes MethodsliftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Down a -> ShowS Source #liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Down a] -> ShowS Source # # Since: base-4.12.0.0 Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) Source #sequenceA :: Applicative f => Down (f a) -> f (Down a) Source #mapM :: Monad m => (a -> m b) -> Down a -> m (Down b) Source #sequence :: Monad m => Down (m a) -> m (Down a) Source # # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodspure :: a -> Down a Source #(<*>) :: Down (a -> b) -> Down a -> Down b Source #liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source #(*>) :: Down a -> Down b -> Down b Source #(<*) :: Down a -> Down b -> Down a Source # # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodsfmap :: (a -> b) -> Down a -> Down b Source #(<\$) :: a -> Down b -> Down a Source # # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(>>=) :: Down a -> (a -> Down b) -> Down b Source #(>>) :: Down a -> Down b -> Down b Source #return :: a -> Down a Source # # Instance detailsDefined in GHC.Generics Associated Typestype Rep1 Down :: k -> Type Source # Methodsfrom1 :: forall (a :: k). Down a -> Rep1 Down a Source #to1 :: forall (a :: k). Rep1 Down a -> Down a Source # Data a => Data (Down a) # Since: base-4.12.0.0 Instance detailsDefined in Data.Data Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Down a -> c (Down a) Source #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Down a) Source #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Down a)) Source #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Down a)) Source #gmapT :: (forall b. Data b => b -> b) -> Down a -> Down a Source #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r Source #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r Source #gmapQ :: (forall d. Data d => d -> u) -> Down a -> [u] Source #gmapQi :: Int -> (forall d. Data d => d -> u) -> Down a -> u Source #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source # Storable a => Storable (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord MethodssizeOf :: Down a -> Int Source #alignment :: Down a -> Int Source #peekElemOff :: Ptr (Down a) -> Int -> IO (Down a) Source #pokeElemOff :: Ptr (Down a) -> Int -> Down a -> IO () Source #peekByteOff :: Ptr b -> Int -> IO (Down a) Source #pokeByteOff :: Ptr b -> Int -> Down a -> IO () Source #peek :: Ptr (Down a) -> IO (Down a) Source #poke :: Ptr (Down a) -> Down a -> IO () Source # Monoid a => Monoid (Down a) # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodsmappend :: Down a -> Down a -> Down a Source #mconcat :: [Down a] -> Down a Source # Semigroup a => Semigroup (Down a) # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(<>) :: Down a -> Down a -> Down a Source #sconcat :: NonEmpty (Down a) -> Down a Source #stimes :: Integral b => b -> Down a -> Down a Source # Bits a => Bits (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methods(.&.) :: Down a -> Down a -> Down a Source #(.|.) :: Down a -> Down a -> Down a Source #xor :: Down a -> Down a -> Down a Source #complement :: Down a -> Down a Source #shift :: Down a -> Int -> Down a Source #rotate :: Down a -> Int -> Down a Source #bit :: Int -> Down a Source #setBit :: Down a -> Int -> Down a Source #clearBit :: Down a -> Int -> Down a Source #complementBit :: Down a -> Int -> Down a Source #testBit :: Down a -> Int -> Bool Source #bitSize :: Down a -> Int Source #isSigned :: Down a -> Bool Source #shiftL :: Down a -> Int -> Down a Source #unsafeShiftL :: Down a -> Int -> Down a Source #shiftR :: Down a -> Int -> Down a Source #unsafeShiftR :: Down a -> Int -> Down a Source #rotateL :: Down a -> Int -> Down a Source #rotateR :: Down a -> Int -> Down a Source #popCount :: Down a -> Int Source # FiniteBits a => FiniteBits (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methods Bounded a => Bounded (Down a) # Swaps minBound and maxBound of the underlying type.Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methods Floating a => Floating (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methodsexp :: Down a -> Down a Source #log :: Down a -> Down a Source #sqrt :: Down a -> Down a Source #(**) :: Down a -> Down a -> Down a Source #logBase :: Down a -> Down a -> Down a Source #sin :: Down a -> Down a Source #cos :: Down a -> Down a Source #tan :: Down a -> Down a Source #asin :: Down a -> Down a Source #acos :: Down a -> Down a Source #atan :: Down a -> Down a Source #sinh :: Down a -> Down a Source #cosh :: Down a -> Down a Source #tanh :: Down a -> Down a Source #asinh :: Down a -> Down a Source #acosh :: Down a -> Down a Source #atanh :: Down a -> Down a Source #log1p :: Down a -> Down a Source #expm1 :: Down a -> Down a Source #log1pexp :: Down a -> Down a Source #log1mexp :: Down a -> Down a Source # RealFloat a => RealFloat (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord MethodsfloatRange :: Down a -> (Int, Int) Source #decodeFloat :: Down a -> (Integer, Int) Source #exponent :: Down a -> Int Source #significand :: Down a -> Down a Source #scaleFloat :: Int -> Down a -> Down a Source #isNaN :: Down a -> Bool Source #isIEEE :: Down a -> Bool Source #atan2 :: Down a -> Down a -> Down a Source # Generic (Down a) # Instance detailsDefined in GHC.Generics Associated Typestype Rep (Down a) :: Type -> Type Source # Methodsfrom :: Down a -> Rep (Down a) x Source #to :: Rep (Down a) x -> Down a Source # Ix a => Ix (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methodsrange :: (Down a, Down a) -> [Down a] Source #index :: (Down a, Down a) -> Down a -> Int Source #unsafeIndex :: (Down a, Down a) -> Down a -> Int Source #inRange :: (Down a, Down a) -> Down a -> Bool Source #rangeSize :: (Down a, Down a) -> Int Source #unsafeRangeSize :: (Down a, Down a) -> Int Source # Num a => Num (Down a) # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(+) :: Down a -> Down a -> Down a Source #(-) :: Down a -> Down a -> Down a Source #(*) :: Down a -> Down a -> Down a Source #negate :: Down a -> Down a Source #abs :: Down a -> Down a Source #signum :: Down a -> Down a Source # Read a => Read (Down a) # This instance would be equivalent to the derived instances of the Down newtype if the getDown field were removedSince: base-4.7.0.0 Instance detailsDefined in Data.Ord MethodsreadsPrec :: Int -> ReadS (Down a) Source # Fractional a => Fractional (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methods(/) :: Down a -> Down a -> Down a Source #recip :: Down a -> Down a Source # Real a => Real (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord Methods RealFrac a => RealFrac (Down a) # Since: base-4.14.0.0 Instance detailsDefined in Data.Ord MethodsproperFraction :: Integral b => Down a -> (b, Down a) Source #truncate :: Integral b => Down a -> b Source #round :: Integral b => Down a -> b Source #ceiling :: Integral b => Down a -> b Source #floor :: Integral b => Down a -> b Source # Show a => Show (Down a) # This instance would be equivalent to the derived instances of the Down newtype if the getDown field were removedSince: base-4.7.0.0 Instance detailsDefined in Data.Ord MethodsshowsPrec :: Int -> Down a -> ShowS Source #show :: Down a -> String Source #showList :: [Down a] -> ShowS Source # Eq a => Eq (Down a) # Since: base-4.6.0.0 Instance detailsDefined in Data.Ord Methods(==) :: Down a -> Down a -> Bool Source #(/=) :: Down a -> Down a -> Bool Source # Ord a => Ord (Down a) # Since: base-4.6.0.0 Instance detailsDefined in Data.Ord Methodscompare :: Down a -> Down a -> Ordering Source #(<) :: Down a -> Down a -> Bool Source #(<=) :: Down a -> Down a -> Bool Source #(>) :: Down a -> Down a -> Bool Source #(>=) :: Down a -> Down a -> Bool Source #max :: Down a -> Down a -> Down a Source #min :: Down a -> Down a -> Down a Source # type Rep1 Down # Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics type Rep1 Down = D1 ('MetaData "Down" "Data.Ord" "base" 'True) (C1 ('MetaCons "Down" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDown") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) type Rep (Down a) # Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics type Rep (Down a) = D1 ('MetaData "Down" "Data.Ord" "base" 'True) (C1 ('MetaCons "Down" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDown") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

comparing :: Ord a => (b -> a) -> b -> b -> Ordering Source #

comparing p x y = compare (p x) (p y)

Useful combinator for use in conjunction with the xxxBy family of functions from Data.List, for example:

  ... sortBy (comparing fst) ...

clamp :: Ord a => (a, a) -> a -> a Source #

clamp (low, high) a = min high (max a low)

Function for ensursing the value a is within the inclusive bounds given by low and high. If it is, a is returned unchanged. The result is otherwise low if a <= low, or high if high <= a.

When clamp is used at Double and Float, it has NaN propagating semantics in its second argument. That is, clamp (l,h) NaN = NaN, but clamp (NaN, NaN) x = x.

>>> clamp (0, 10) 2
2

>>> clamp ('a', 'm') 'x'
'm'