```{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE DeriveTraversable          #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PolyKinds                  #-}
{-# LANGUAGE StandaloneDeriving         #-}
{-# LANGUAGE UndecidableInstances       #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Numeric.ProductOrd.Partial
-- Copyright   :  (c) Artem Chirkin
--
--
-- Compare product types using partial `Ord` instances:
--
-- *  if nor \( a > b \), nor \( b > a \), neither, \( a = b \),
--      then @compare a b == undefined@
--
-- To remind yourself that `ProductOrd` is partial, you may
--  import it qualified, e.g.
--
-- >  import qualified Numeric.ProductOrd.Partial as Partial
--
-----------------------------------------------------------------------------
module Numeric.ProductOrd.Partial (ProductOrd (..), toOrdering) where

import Data.Bits         (Bits, FiniteBits)
import Data.Coerce
import Data.Data
import Data.Foldable
import Data.Kind         (Type)
import Foreign.Storable  (Storable)
import GHC.Generics

import Numeric.ProductOrd
import Numeric.TypedList

{-|
Redefine `Ord` instance for a type which is a cartesian product --
as a partial __[product order](https://en.wikipedia.org/wiki/Product_order)__.

instance is not particularly correct.
However, it turns out to be very useful for comparing vector or tuple-like types.

The implementation of `ProductOrd` in this module
workarounds this by using a __partial @compare@ function in an `Eq` instance__:
\[
\neg (a > b) \land \neg (b > a) \land \neg (a = b)
\Rightarrow \mathtt{compare\ a\ b == undefined}
\]

Another inconsistency with the Haskell Report is the `min` and `max` functions;
these are simply element-wise minimum and maximum here.
Thus, these instances preserve important properties like
@min a b <= a && min a b <= b@, but do not preserve
a property that @min a b == a || min a b == b@.

All of this is really useful in geometry applications and for calculating things
like [Pareto dominance](https://en.wikipedia.org/wiki/Pareto_efficiency),
but should be used with care.
In particular, never use @ProductOrd@ as a key to a @Set@ or a @Map@!
-}
newtype ProductOrd a = ProductOrd { ProductOrd a -> a
getProductOrd :: a }
deriving ( ProductOrd a -> ProductOrd a -> Bool
(ProductOrd a -> ProductOrd a -> Bool)
-> (ProductOrd a -> ProductOrd a -> Bool) -> Eq (ProductOrd a)
forall a. Eq a => ProductOrd a -> ProductOrd a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProductOrd a -> ProductOrd a -> Bool
\$c/= :: forall a. Eq a => ProductOrd a -> ProductOrd a -> Bool
== :: ProductOrd a -> ProductOrd a -> Bool
\$c== :: forall a. Eq a => ProductOrd a -> ProductOrd a -> Bool
Eq, Int -> ProductOrd a -> ShowS
[ProductOrd a] -> ShowS
ProductOrd a -> String
(Int -> ProductOrd a -> ShowS)
-> (ProductOrd a -> String)
-> ([ProductOrd a] -> ShowS)
-> Show (ProductOrd a)
forall a. Show a => Int -> ProductOrd a -> ShowS
forall a. Show a => [ProductOrd a] -> ShowS
forall a. Show a => ProductOrd a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProductOrd a] -> ShowS
\$cshowList :: forall a. Show a => [ProductOrd a] -> ShowS
show :: ProductOrd a -> String
\$cshow :: forall a. Show a => ProductOrd a -> String
showsPrec :: Int -> ProductOrd a -> ShowS
\$cshowsPrec :: forall a. Show a => Int -> ProductOrd a -> ShowS
forall a.
DataType
Constr
Typeable (ProductOrd a)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a))
-> (ProductOrd a -> Constr)
-> (ProductOrd a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ProductOrd a)))
-> ((forall b. Data b => b -> b) -> ProductOrd a -> ProductOrd a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r)
-> (forall u. (forall d. Data d => d -> u) -> ProductOrd a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ProductOrd a -> u)
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a))
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a))
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a))
-> Data (ProductOrd a)
ProductOrd a -> DataType
ProductOrd a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a))
(forall b. Data b => b -> b) -> ProductOrd a -> ProductOrd a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a)
forall a. Data a => Typeable (ProductOrd a)
forall a. Data a => ProductOrd a -> DataType
forall a. Data a => ProductOrd a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> ProductOrd a -> ProductOrd a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ProductOrd a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> ProductOrd a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
forall a (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
forall a (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ProductOrd a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ProductOrd a -> u
forall u. (forall d. Data d => d -> u) -> ProductOrd a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
forall (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
forall (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ProductOrd a))
\$cProductOrd :: Constr
\$tProductOrd :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
\$cgmapMo :: forall a (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
gmapMp :: (forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
\$cgmapMp :: forall a (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
gmapM :: (forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
\$cgmapM :: forall a (m :: * -> *).
(forall d. Data d => d -> m d) -> ProductOrd a -> m (ProductOrd a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> ProductOrd a -> u
\$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ProductOrd a -> u
gmapQ :: (forall d. Data d => d -> u) -> ProductOrd a -> [u]
\$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> ProductOrd a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
\$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
\$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ProductOrd a -> r
gmapT :: (forall b. Data b => b -> b) -> ProductOrd a -> ProductOrd a
\$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> ProductOrd a -> ProductOrd a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ProductOrd a))
\$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ProductOrd a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a))
\$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ProductOrd a))
dataTypeOf :: ProductOrd a -> DataType
\$cdataTypeOf :: forall a. Data a => ProductOrd a -> DataType
toConstr :: ProductOrd a -> Constr
\$ctoConstr :: forall a. Data a => ProductOrd a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a)
\$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ProductOrd a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a)
\$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ProductOrd a -> c (ProductOrd a)
\$cp1Data :: forall a. Data a => Typeable (ProductOrd a)
Data, Typeable, (forall x. ProductOrd a -> Rep (ProductOrd a) x)
-> (forall x. Rep (ProductOrd a) x -> ProductOrd a)
-> Generic (ProductOrd a)
forall x. Rep (ProductOrd a) x -> ProductOrd a
forall x. ProductOrd a -> Rep (ProductOrd a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (ProductOrd a) x -> ProductOrd a
forall a x. ProductOrd a -> Rep (ProductOrd a) x
\$cto :: forall a x. Rep (ProductOrd a) x -> ProductOrd a
\$cfrom :: forall a x. ProductOrd a -> Rep (ProductOrd a) x
Generic, (forall a. ProductOrd a -> Rep1 ProductOrd a)
-> (forall a. Rep1 ProductOrd a -> ProductOrd a)
-> Generic1 ProductOrd
forall a. Rep1 ProductOrd a -> ProductOrd a
forall a. ProductOrd a -> Rep1 ProductOrd a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
\$cto1 :: forall a. Rep1 ProductOrd a -> ProductOrd a
\$cfrom1 :: forall a. ProductOrd a -> Rep1 ProductOrd a
Generic1
, Integer -> ProductOrd a
ProductOrd a -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
(ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (Integer -> ProductOrd a)
-> Num (ProductOrd a)
forall a. Num a => Integer -> ProductOrd a
forall a. Num a => ProductOrd a -> ProductOrd a
forall a. Num a => ProductOrd a -> ProductOrd a -> ProductOrd a
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> ProductOrd a
\$cfromInteger :: forall a. Num a => Integer -> ProductOrd a
signum :: ProductOrd a -> ProductOrd a
\$csignum :: forall a. Num a => ProductOrd a -> ProductOrd a
abs :: ProductOrd a -> ProductOrd a
\$cabs :: forall a. Num a => ProductOrd a -> ProductOrd a
negate :: ProductOrd a -> ProductOrd a
\$cnegate :: forall a. Num a => ProductOrd a -> ProductOrd a
* :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c* :: forall a. Num a => ProductOrd a -> ProductOrd a -> ProductOrd a
- :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c- :: forall a. Num a => ProductOrd a -> ProductOrd a -> ProductOrd a
+ :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c+ :: forall a. Num a => ProductOrd a -> ProductOrd a -> ProductOrd a
Num, Int -> ProductOrd a
ProductOrd a -> Int
ProductOrd a -> [ProductOrd a]
ProductOrd a -> ProductOrd a
ProductOrd a -> ProductOrd a -> [ProductOrd a]
ProductOrd a -> ProductOrd a -> ProductOrd a -> [ProductOrd a]
(ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (Int -> ProductOrd a)
-> (ProductOrd a -> Int)
-> (ProductOrd a -> [ProductOrd a])
-> (ProductOrd a -> ProductOrd a -> [ProductOrd a])
-> (ProductOrd a -> ProductOrd a -> [ProductOrd a])
-> (ProductOrd a -> ProductOrd a -> ProductOrd a -> [ProductOrd a])
-> Enum (ProductOrd a)
forall a. Enum a => Int -> ProductOrd a
forall a. Enum a => ProductOrd a -> Int
forall a. Enum a => ProductOrd a -> [ProductOrd a]
forall a. Enum a => ProductOrd a -> ProductOrd a
forall a. Enum a => ProductOrd a -> ProductOrd a -> [ProductOrd a]
forall a.
Enum a =>
ProductOrd a -> ProductOrd a -> ProductOrd a -> [ProductOrd a]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ProductOrd a -> ProductOrd a -> ProductOrd a -> [ProductOrd a]
\$cenumFromThenTo :: forall a.
Enum a =>
ProductOrd a -> ProductOrd a -> ProductOrd a -> [ProductOrd a]
enumFromTo :: ProductOrd a -> ProductOrd a -> [ProductOrd a]
\$cenumFromTo :: forall a. Enum a => ProductOrd a -> ProductOrd a -> [ProductOrd a]
enumFromThen :: ProductOrd a -> ProductOrd a -> [ProductOrd a]
\$cenumFromThen :: forall a. Enum a => ProductOrd a -> ProductOrd a -> [ProductOrd a]
enumFrom :: ProductOrd a -> [ProductOrd a]
\$cenumFrom :: forall a. Enum a => ProductOrd a -> [ProductOrd a]
fromEnum :: ProductOrd a -> Int
\$cfromEnum :: forall a. Enum a => ProductOrd a -> Int
toEnum :: Int -> ProductOrd a
\$ctoEnum :: forall a. Enum a => Int -> ProductOrd a
pred :: ProductOrd a -> ProductOrd a
\$cpred :: forall a. Enum a => ProductOrd a -> ProductOrd a
succ :: ProductOrd a -> ProductOrd a
\$csucc :: forall a. Enum a => ProductOrd a -> ProductOrd a
Enum, ProductOrd a
ProductOrd a -> ProductOrd a -> Bounded (ProductOrd a)
forall a. a -> a -> Bounded a
forall a. Bounded a => ProductOrd a
maxBound :: ProductOrd a
\$cmaxBound :: forall a. Bounded a => ProductOrd a
minBound :: ProductOrd a
\$cminBound :: forall a. Bounded a => ProductOrd a
Bounded, Fractional (ProductOrd a)
ProductOrd a
Fractional (ProductOrd a)
-> ProductOrd a
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> Floating (ProductOrd a)
ProductOrd a -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a. Floating a => Fractional (ProductOrd a)
forall a. Floating a => ProductOrd a
forall a. Floating a => ProductOrd a -> ProductOrd a
forall a.
Floating a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a.
Fractional a
-> a
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> Floating a
log1mexp :: ProductOrd a -> ProductOrd a
\$clog1mexp :: forall a. Floating a => ProductOrd a -> ProductOrd a
log1pexp :: ProductOrd a -> ProductOrd a
\$clog1pexp :: forall a. Floating a => ProductOrd a -> ProductOrd a
expm1 :: ProductOrd a -> ProductOrd a
\$cexpm1 :: forall a. Floating a => ProductOrd a -> ProductOrd a
log1p :: ProductOrd a -> ProductOrd a
\$clog1p :: forall a. Floating a => ProductOrd a -> ProductOrd a
atanh :: ProductOrd a -> ProductOrd a
\$catanh :: forall a. Floating a => ProductOrd a -> ProductOrd a
acosh :: ProductOrd a -> ProductOrd a
\$cacosh :: forall a. Floating a => ProductOrd a -> ProductOrd a
asinh :: ProductOrd a -> ProductOrd a
\$casinh :: forall a. Floating a => ProductOrd a -> ProductOrd a
tanh :: ProductOrd a -> ProductOrd a
\$ctanh :: forall a. Floating a => ProductOrd a -> ProductOrd a
cosh :: ProductOrd a -> ProductOrd a
\$ccosh :: forall a. Floating a => ProductOrd a -> ProductOrd a
sinh :: ProductOrd a -> ProductOrd a
\$csinh :: forall a. Floating a => ProductOrd a -> ProductOrd a
atan :: ProductOrd a -> ProductOrd a
\$catan :: forall a. Floating a => ProductOrd a -> ProductOrd a
acos :: ProductOrd a -> ProductOrd a
\$cacos :: forall a. Floating a => ProductOrd a -> ProductOrd a
asin :: ProductOrd a -> ProductOrd a
\$casin :: forall a. Floating a => ProductOrd a -> ProductOrd a
tan :: ProductOrd a -> ProductOrd a
\$ctan :: forall a. Floating a => ProductOrd a -> ProductOrd a
cos :: ProductOrd a -> ProductOrd a
\$ccos :: forall a. Floating a => ProductOrd a -> ProductOrd a
sin :: ProductOrd a -> ProductOrd a
\$csin :: forall a. Floating a => ProductOrd a -> ProductOrd a
logBase :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$clogBase :: forall a.
Floating a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
** :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c** :: forall a.
Floating a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
sqrt :: ProductOrd a -> ProductOrd a
\$csqrt :: forall a. Floating a => ProductOrd a -> ProductOrd a
log :: ProductOrd a -> ProductOrd a
\$clog :: forall a. Floating a => ProductOrd a -> ProductOrd a
exp :: ProductOrd a -> ProductOrd a
\$cexp :: forall a. Floating a => ProductOrd a -> ProductOrd a
pi :: ProductOrd a
\$cpi :: forall a. Floating a => ProductOrd a
\$cp1Floating :: forall a. Floating a => Fractional (ProductOrd a)
Floating, Num (ProductOrd a)
Num (ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (Rational -> ProductOrd a)
-> Fractional (ProductOrd a)
Rational -> ProductOrd a
ProductOrd a -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a. Fractional a => Num (ProductOrd a)
forall a. Fractional a => Rational -> ProductOrd a
forall a. Fractional a => ProductOrd a -> ProductOrd a
forall a.
Fractional a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a.
Num a
-> (a -> a -> a) -> (a -> a) -> (Rational -> a) -> Fractional a
fromRational :: Rational -> ProductOrd a
\$cfromRational :: forall a. Fractional a => Rational -> ProductOrd a
recip :: ProductOrd a -> ProductOrd a
\$crecip :: forall a. Fractional a => ProductOrd a -> ProductOrd a
/ :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c/ :: forall a.
Fractional a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
\$cp1Fractional :: forall a. Fractional a => Num (ProductOrd a)
Fractional
, b -> ProductOrd a -> ProductOrd a
NonEmpty (ProductOrd a) -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
(ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (NonEmpty (ProductOrd a) -> ProductOrd a)
-> (forall b. Integral b => b -> ProductOrd a -> ProductOrd a)
-> Semigroup (ProductOrd a)
forall b. Integral b => b -> ProductOrd a -> ProductOrd a
forall a. Semigroup a => NonEmpty (ProductOrd a) -> ProductOrd a
forall a.
Semigroup a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a b.
(Semigroup a, Integral b) =>
b -> ProductOrd a -> ProductOrd a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
stimes :: b -> ProductOrd a -> ProductOrd a
\$cstimes :: forall a b.
(Semigroup a, Integral b) =>
b -> ProductOrd a -> ProductOrd a
sconcat :: NonEmpty (ProductOrd a) -> ProductOrd a
\$csconcat :: forall a. Semigroup a => NonEmpty (ProductOrd a) -> ProductOrd a
<> :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c<> :: forall a.
Semigroup a =>
ProductOrd a -> ProductOrd a -> ProductOrd a
Semigroup, Semigroup (ProductOrd a)
ProductOrd a
Semigroup (ProductOrd a)
-> ProductOrd a
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> ([ProductOrd a] -> ProductOrd a)
-> Monoid (ProductOrd a)
[ProductOrd a] -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a.
Semigroup a -> a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall a. Monoid a => Semigroup (ProductOrd a)
forall a. Monoid a => ProductOrd a
forall a. Monoid a => [ProductOrd a] -> ProductOrd a
forall a. Monoid a => ProductOrd a -> ProductOrd a -> ProductOrd a
mconcat :: [ProductOrd a] -> ProductOrd a
\$cmconcat :: forall a. Monoid a => [ProductOrd a] -> ProductOrd a
mappend :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$cmappend :: forall a. Monoid a => ProductOrd a -> ProductOrd a -> ProductOrd a
mempty :: ProductOrd a
\$cmempty :: forall a. Monoid a => ProductOrd a
\$cp1Monoid :: forall a. Monoid a => Semigroup (ProductOrd a)
Monoid, Ptr b -> Int -> IO (ProductOrd a)
Ptr b -> Int -> ProductOrd a -> IO ()
Ptr (ProductOrd a) -> IO (ProductOrd a)
Ptr (ProductOrd a) -> Int -> IO (ProductOrd a)
Ptr (ProductOrd a) -> Int -> ProductOrd a -> IO ()
Ptr (ProductOrd a) -> ProductOrd a -> IO ()
ProductOrd a -> Int
(ProductOrd a -> Int)
-> (ProductOrd a -> Int)
-> (Ptr (ProductOrd a) -> Int -> IO (ProductOrd a))
-> (Ptr (ProductOrd a) -> Int -> ProductOrd a -> IO ())
-> (forall b. Ptr b -> Int -> IO (ProductOrd a))
-> (forall b. Ptr b -> Int -> ProductOrd a -> IO ())
-> (Ptr (ProductOrd a) -> IO (ProductOrd a))
-> (Ptr (ProductOrd a) -> ProductOrd a -> IO ())
-> Storable (ProductOrd a)
forall b. Ptr b -> Int -> IO (ProductOrd a)
forall b. Ptr b -> Int -> ProductOrd a -> IO ()
forall a. Storable a => Ptr (ProductOrd a) -> IO (ProductOrd a)
forall a.
Storable a =>
Ptr (ProductOrd a) -> Int -> IO (ProductOrd a)
forall a.
Storable a =>
Ptr (ProductOrd a) -> Int -> ProductOrd a -> IO ()
forall a. Storable a => Ptr (ProductOrd a) -> ProductOrd a -> IO ()
forall a. Storable a => ProductOrd a -> Int
forall a b. Storable a => Ptr b -> Int -> IO (ProductOrd a)
forall a b. Storable a => Ptr b -> Int -> ProductOrd a -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr (ProductOrd a) -> ProductOrd a -> IO ()
\$cpoke :: forall a. Storable a => Ptr (ProductOrd a) -> ProductOrd a -> IO ()
peek :: Ptr (ProductOrd a) -> IO (ProductOrd a)
\$cpeek :: forall a. Storable a => Ptr (ProductOrd a) -> IO (ProductOrd a)
pokeByteOff :: Ptr b -> Int -> ProductOrd a -> IO ()
\$cpokeByteOff :: forall a b. Storable a => Ptr b -> Int -> ProductOrd a -> IO ()
peekByteOff :: Ptr b -> Int -> IO (ProductOrd a)
\$cpeekByteOff :: forall a b. Storable a => Ptr b -> Int -> IO (ProductOrd a)
pokeElemOff :: Ptr (ProductOrd a) -> Int -> ProductOrd a -> IO ()
\$cpokeElemOff :: forall a.
Storable a =>
Ptr (ProductOrd a) -> Int -> ProductOrd a -> IO ()
peekElemOff :: Ptr (ProductOrd a) -> Int -> IO (ProductOrd a)
\$cpeekElemOff :: forall a.
Storable a =>
Ptr (ProductOrd a) -> Int -> IO (ProductOrd a)
alignment :: ProductOrd a -> Int
\$calignment :: forall a. Storable a => ProductOrd a -> Int
sizeOf :: ProductOrd a -> Int
\$csizeOf :: forall a. Storable a => ProductOrd a -> Int
Storable, Functor ProductOrd
Foldable ProductOrd
Functor ProductOrd
-> Foldable ProductOrd
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ProductOrd a -> f (ProductOrd b))
-> (forall (f :: * -> *) a.
Applicative f =>
ProductOrd (f a) -> f (ProductOrd a))
-> (forall (m :: * -> *) a b.
(a -> m b) -> ProductOrd a -> m (ProductOrd b))
-> (forall (m :: * -> *) a.
ProductOrd (m a) -> m (ProductOrd a))
-> Traversable ProductOrd
(a -> f b) -> ProductOrd a -> f (ProductOrd b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
ProductOrd (m a) -> m (ProductOrd a)
forall (f :: * -> *) a.
Applicative f =>
ProductOrd (f a) -> f (ProductOrd a)
forall (m :: * -> *) a b.
(a -> m b) -> ProductOrd a -> m (ProductOrd b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ProductOrd a -> f (ProductOrd b)
sequence :: ProductOrd (m a) -> m (ProductOrd a)
\$csequence :: forall (m :: * -> *) a.
ProductOrd (m a) -> m (ProductOrd a)
mapM :: (a -> m b) -> ProductOrd a -> m (ProductOrd b)
\$cmapM :: forall (m :: * -> *) a b.
(a -> m b) -> ProductOrd a -> m (ProductOrd b)
sequenceA :: ProductOrd (f a) -> f (ProductOrd a)
\$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ProductOrd (f a) -> f (ProductOrd a)
traverse :: (a -> f b) -> ProductOrd a -> f (ProductOrd b)
\$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ProductOrd a -> f (ProductOrd b)
\$cp2Traversable :: Foldable ProductOrd
\$cp1Traversable :: Functor ProductOrd
Traversable
, Eq (ProductOrd a)
ProductOrd a
Eq (ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> ProductOrd a
-> (Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> Bool)
-> (ProductOrd a -> Maybe Int)
-> (ProductOrd a -> Int)
-> (ProductOrd a -> Bool)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int -> ProductOrd a)
-> (ProductOrd a -> Int)
-> Bits (ProductOrd a)
Int -> ProductOrd a
ProductOrd a -> Bool
ProductOrd a -> Int
ProductOrd a -> Maybe Int
ProductOrd a -> ProductOrd a
ProductOrd a -> Int -> Bool
ProductOrd a -> Int -> ProductOrd a
ProductOrd a -> ProductOrd a -> ProductOrd a
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
forall a. Bits a => Eq (ProductOrd a)
forall a. Bits a => ProductOrd a
forall a. Bits a => Int -> ProductOrd a
forall a. Bits a => ProductOrd a -> Bool
forall a. Bits a => ProductOrd a -> Int
forall a. Bits a => ProductOrd a -> Maybe Int
forall a. Bits a => ProductOrd a -> ProductOrd a
forall a. Bits a => ProductOrd a -> Int -> Bool
forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
forall a. Bits a => ProductOrd a -> ProductOrd a -> ProductOrd a
popCount :: ProductOrd a -> Int
\$cpopCount :: forall a. Bits a => ProductOrd a -> Int
rotateR :: ProductOrd a -> Int -> ProductOrd a
\$crotateR :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
rotateL :: ProductOrd a -> Int -> ProductOrd a
\$crotateL :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
unsafeShiftR :: ProductOrd a -> Int -> ProductOrd a
\$cunsafeShiftR :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
shiftR :: ProductOrd a -> Int -> ProductOrd a
\$cshiftR :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
unsafeShiftL :: ProductOrd a -> Int -> ProductOrd a
\$cunsafeShiftL :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
shiftL :: ProductOrd a -> Int -> ProductOrd a
\$cshiftL :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
isSigned :: ProductOrd a -> Bool
\$cisSigned :: forall a. Bits a => ProductOrd a -> Bool
bitSize :: ProductOrd a -> Int
\$cbitSize :: forall a. Bits a => ProductOrd a -> Int
bitSizeMaybe :: ProductOrd a -> Maybe Int
\$cbitSizeMaybe :: forall a. Bits a => ProductOrd a -> Maybe Int
testBit :: ProductOrd a -> Int -> Bool
\$ctestBit :: forall a. Bits a => ProductOrd a -> Int -> Bool
complementBit :: ProductOrd a -> Int -> ProductOrd a
\$ccomplementBit :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
clearBit :: ProductOrd a -> Int -> ProductOrd a
\$cclearBit :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
setBit :: ProductOrd a -> Int -> ProductOrd a
\$csetBit :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
bit :: Int -> ProductOrd a
\$cbit :: forall a. Bits a => Int -> ProductOrd a
zeroBits :: ProductOrd a
\$czeroBits :: forall a. Bits a => ProductOrd a
rotate :: ProductOrd a -> Int -> ProductOrd a
\$crotate :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
shift :: ProductOrd a -> Int -> ProductOrd a
\$cshift :: forall a. Bits a => ProductOrd a -> Int -> ProductOrd a
complement :: ProductOrd a -> ProductOrd a
\$ccomplement :: forall a. Bits a => ProductOrd a -> ProductOrd a
xor :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$cxor :: forall a. Bits a => ProductOrd a -> ProductOrd a -> ProductOrd a
.|. :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c.|. :: forall a. Bits a => ProductOrd a -> ProductOrd a -> ProductOrd a
.&. :: ProductOrd a -> ProductOrd a -> ProductOrd a
\$c.&. :: forall a. Bits a => ProductOrd a -> ProductOrd a -> ProductOrd a
\$cp1Bits :: forall a. Bits a => Eq (ProductOrd a)
Bits, Bits (ProductOrd a)
Bits (ProductOrd a)
-> (ProductOrd a -> Int)
-> (ProductOrd a -> Int)
-> (ProductOrd a -> Int)
-> FiniteBits (ProductOrd a)
ProductOrd a -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
forall a. FiniteBits a => Bits (ProductOrd a)
forall a. FiniteBits a => ProductOrd a -> Int
countTrailingZeros :: ProductOrd a -> Int
\$ccountTrailingZeros :: forall a. FiniteBits a => ProductOrd a -> Int
countLeadingZeros :: ProductOrd a -> Int
\$ccountLeadingZeros :: forall a. FiniteBits a => ProductOrd a -> Int
finiteBitSize :: ProductOrd a -> Int
\$cfiniteBitSize :: forall a. FiniteBits a => ProductOrd a -> Int
\$cp1FiniteBits :: forall a. FiniteBits a => Bits (ProductOrd a)
FiniteBits)

deriving instance (Ord (ProductOrd a), Integral a)   => Integral (ProductOrd a)
deriving instance (Ord (ProductOrd a), Real a)       => Real (ProductOrd a)
deriving instance (Ord (ProductOrd a), RealFrac a)   => RealFrac (ProductOrd a)
deriving instance (Ord (ProductOrd a), RealFloat a)  => RealFloat (ProductOrd a)

instance Foldable ProductOrd where
foldMap :: (a -> m) -> ProductOrd a -> m
foldMap                  = (a -> m) -> ProductOrd a -> m
coerce
elem :: a -> ProductOrd a -> Bool
elem                     = (a -> a -> Bool) -> a -> ProductOrd a -> Bool
forall a. (a -> a -> Bool) -> a -> ProductOrd a -> Bool
k a -> a -> Bool
forall a. Eq a => a -> a -> Bool
(==)
where
k :: (a -> a -> Bool) -> a -> ProductOrd a -> Bool
k :: (a -> a -> Bool) -> a -> ProductOrd a -> Bool
k = (a -> a -> Bool) -> a -> ProductOrd a -> Bool
coerce
foldl :: (b -> a -> b) -> b -> ProductOrd a -> b
foldl                    = (b -> a -> b) -> b -> ProductOrd a -> b
coerce
foldl' :: (b -> a -> b) -> b -> ProductOrd a -> b
foldl'                   = (b -> a -> b) -> b -> ProductOrd a -> b
coerce
foldl1 :: (a -> a -> a) -> ProductOrd a -> a
foldl1 a -> a -> a
_                 = ProductOrd a -> a
coerce
foldr :: (a -> b -> b) -> b -> ProductOrd a -> b
foldr a -> b -> b
f b
z (ProductOrd a
x) = a -> b -> b
f a
x b
z
foldr' :: (a -> b -> b) -> b -> ProductOrd a -> b
foldr'                   = (a -> b -> b) -> b -> ProductOrd a -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr
foldr1 :: (a -> a -> a) -> ProductOrd a -> a
foldr1 a -> a -> a
_                 = ProductOrd a -> a
coerce
length :: ProductOrd a -> Int
length ProductOrd a
_                 = Int
1
maximum :: ProductOrd a -> a
maximum                  = ProductOrd a -> a
coerce
minimum :: ProductOrd a -> a
minimum                  = ProductOrd a -> a
coerce
null :: ProductOrd a -> Bool
null ProductOrd a
_                   = Bool
False
product :: ProductOrd a -> a
product                  = ProductOrd a -> a
coerce
sum :: ProductOrd a -> a
sum                      = ProductOrd a -> a
coerce
toList :: ProductOrd a -> [a]
toList (ProductOrd a
x)    = [a
x]

instance Functor ProductOrd where
fmap :: (a -> b) -> ProductOrd a -> ProductOrd b
fmap  = (a -> b) -> ProductOrd a -> ProductOrd b
coerce

instance Applicative ProductOrd where
pure :: a -> ProductOrd a
pure  = a -> ProductOrd a
forall a. a -> ProductOrd a
ProductOrd
<*> :: ProductOrd (a -> b) -> ProductOrd a -> ProductOrd b
(<*>) = ProductOrd (a -> b) -> ProductOrd a -> ProductOrd b
coerce

ProductOrd a
m >>= :: ProductOrd a -> (a -> ProductOrd b) -> ProductOrd b
>>= a -> ProductOrd b
k = a -> ProductOrd b
k (ProductOrd a -> a
forall a. ProductOrd a -> a
getProductOrd ProductOrd a
m)

mfix :: (a -> ProductOrd a) -> ProductOrd a
mfix a -> ProductOrd a
f   = a -> ProductOrd a
forall a. a -> ProductOrd a
ProductOrd ((a -> a) -> a
forall a. (a -> a) -> a
fix (ProductOrd a -> a
forall a. ProductOrd a -> a
getProductOrd (ProductOrd a -> a) -> (a -> ProductOrd a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> ProductOrd a
f))

mzipWith :: (a -> b -> c) -> ProductOrd a -> ProductOrd b -> ProductOrd c
mzipWith = (a -> b -> c) -> ProductOrd a -> ProductOrd b -> ProductOrd c
coerce
munzip :: ProductOrd (a, b) -> (ProductOrd a, ProductOrd b)
munzip   = ProductOrd (a, b) -> (ProductOrd a, ProductOrd b)
coerce

instance {-# INCOHERENT #-}
All Ord (Map f xs)
=> Eq (ProductOrd (TypedList (f :: k -> Type) (xs :: [k]))) where
ProductOrd TypedList f xs
U == :: ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs) -> Bool
== ProductOrd TypedList f xs
U = Bool
True
ProductOrd (f y
a :* TypedList f ys
as) == ProductOrd (f y
b :* TypedList f ys
bs)
= f y
a f y -> f y -> Bool
forall a. Eq a => a -> a -> Bool
== f y
f y
b Bool -> Bool -> Bool
&& TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
as ProductOrd (TypedList f ys) -> ProductOrd (TypedList f ys) -> Bool
forall a. Eq a => a -> a -> Bool
== TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
bs

instance All Ord (Map f xs)
=> Ord (ProductOrd (TypedList (f :: k -> Type) (xs :: [k]))) where
ProductOrd TypedList f xs
x > :: ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs) -> Bool
> ProductOrd TypedList f xs
y = TypedList f xs -> TypedList f xs -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp TypedList f xs
x TypedList f xs
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd TypedList f xs
x < :: ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs) -> Bool
< ProductOrd TypedList f xs
y = TypedList f xs -> TypedList f xs -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp TypedList f xs
x TypedList f xs
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd TypedList f xs
U >= :: ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs) -> Bool
>= ProductOrd TypedList f xs
U = Bool
True
ProductOrd (f y
a :* TypedList f ys
as) >= ProductOrd (f y
b :* TypedList f ys
bs)
= f y
a f y -> f y -> Bool
forall a. Ord a => a -> a -> Bool
>= f y
f y
b Bool -> Bool -> Bool
&& TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
as ProductOrd (TypedList f ys) -> ProductOrd (TypedList f ys) -> Bool
forall a. Ord a => a -> a -> Bool
>= TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
bs
ProductOrd TypedList f xs
U <= :: ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs) -> Bool
<= ProductOrd TypedList f xs
U = Bool
True
ProductOrd (f y
a :* TypedList f ys
as) <= ProductOrd (f y
b :* TypedList f ys
bs)
= f y
a f y -> f y -> Bool
forall a. Ord a => a -> a -> Bool
<= f y
f y
b Bool -> Bool -> Bool
&& TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
as ProductOrd (TypedList f ys) -> ProductOrd (TypedList f ys) -> Bool
forall a. Ord a => a -> a -> Bool
<= TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
bs
compare :: ProductOrd (TypedList f xs)
-> ProductOrd (TypedList f xs) -> Ordering
compare (ProductOrd TypedList f xs
a) (ProductOrd TypedList f xs
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ TypedList f xs -> TypedList f xs -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp TypedList f xs
a TypedList f xs
b
min :: ProductOrd (TypedList f xs)
-> ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs)
min (ProductOrd TypedList f xs
U) (ProductOrd TypedList f xs
U) = TypedList f xs -> ProductOrd (TypedList f xs)
forall a. a -> ProductOrd a
ProductOrd TypedList f xs
forall k (f :: k -> *) (xs :: [k]). (xs ~ '[]) => TypedList f xs
U
min (ProductOrd (f y
a :* TypedList f ys
as)) (ProductOrd (f y
b :* TypedList f ys
bs))
= TypedList f xs -> ProductOrd (TypedList f xs)
forall a. a -> ProductOrd a
ProductOrd (f y -> f y -> f y
forall a. Ord a => a -> a -> a
min f y
a f y
f y
b f y -> TypedList f ys -> TypedList f xs
forall k (f :: k -> *) (xs :: [k]) (y :: k) (ys :: [k]).
(xs ~ (y : ys)) =>
f y -> TypedList f ys -> TypedList f xs
:* ProductOrd (TypedList f ys) -> TypedList f ys
forall a. ProductOrd a -> a
getProductOrd (ProductOrd (TypedList f ys)
-> ProductOrd (TypedList f ys) -> ProductOrd (TypedList f ys)
forall a. Ord a => a -> a -> a
min (TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
as) (TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
bs)))
max :: ProductOrd (TypedList f xs)
-> ProductOrd (TypedList f xs) -> ProductOrd (TypedList f xs)
max (ProductOrd TypedList f xs
U) (ProductOrd TypedList f xs
U) = TypedList f xs -> ProductOrd (TypedList f xs)
forall a. a -> ProductOrd a
ProductOrd TypedList f xs
forall k (f :: k -> *) (xs :: [k]). (xs ~ '[]) => TypedList f xs
U
max (ProductOrd (f y
a :* TypedList f ys
as)) (ProductOrd (f y
b :* TypedList f ys
bs))
= TypedList f xs -> ProductOrd (TypedList f xs)
forall a. a -> ProductOrd a
ProductOrd (f y -> f y -> f y
forall a. Ord a => a -> a -> a
max f y
a f y
f y
b f y -> TypedList f ys -> TypedList f xs
forall k (f :: k -> *) (xs :: [k]) (y :: k) (ys :: [k]).
(xs ~ (y : ys)) =>
f y -> TypedList f ys -> TypedList f xs
:* ProductOrd (TypedList f ys) -> TypedList f ys
forall a. ProductOrd a -> a
getProductOrd (ProductOrd (TypedList f ys)
-> ProductOrd (TypedList f ys) -> ProductOrd (TypedList f ys)
forall a. Ord a => a -> a -> a
max (TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
as) (TypedList f ys -> ProductOrd (TypedList f ys)
forall a. a -> ProductOrd a
ProductOrd TypedList f ys
bs)))

instance (Ord a1, Ord a2) => Ord (ProductOrd (a1, a2)) where
ProductOrd (a1, a2)
x > :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> Bool
> ProductOrd (a1, a2)
y = (a1, a2) -> (a1, a2) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2)
x (a1, a2)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2)
x < :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> Bool
< ProductOrd (a1, a2)
y = (a1, a2) -> (a1, a2) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2)
x (a1, a2)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2) >= :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> Bool
>= ProductOrd (a1
b1, a2
b2)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2) <= :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> Bool
<= ProductOrd (a1
b1, a2
b2)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> Ordering
compare (ProductOrd (a1, a2)
a) (ProductOrd (a1, a2)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2) -> (a1, a2) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2)
a (a1, a2)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> ProductOrd (a1, a2)
min (ProductOrd (a1
a1, a2
a2)) (ProductOrd (a1
b1, a2
b2))
= (a1, a2) -> ProductOrd (a1, a2)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2)
{-# INLINE min #-}
max :: ProductOrd (a1, a2) -> ProductOrd (a1, a2) -> ProductOrd (a1, a2)
max (ProductOrd (a1
a1, a2
a2)) (ProductOrd (a1
b1, a2
b2))
= (a1, a2) -> ProductOrd (a1, a2)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3) => Ord (ProductOrd (a1, a2, a3)) where
ProductOrd (a1, a2, a3)
x > :: ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3) -> Bool
> ProductOrd (a1, a2, a3)
y = (a1, a2, a3) -> (a1, a2, a3) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3)
x (a1, a2, a3)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3)
x < :: ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3) -> Bool
< ProductOrd (a1, a2, a3)
y = (a1, a2, a3) -> (a1, a2, a3) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3)
x (a1, a2, a3)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3) >= :: ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3) <= :: ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3) -> Ordering
compare (ProductOrd (a1, a2, a3)
a) (ProductOrd (a1, a2, a3)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3) -> (a1, a2, a3) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3)
a (a1, a2, a3)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3)
-> ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3)
min (ProductOrd (a1
a1, a2
a2, a3
a3)) (ProductOrd (a1
b1, a2
b2, a3
b3))
= (a1, a2, a3) -> ProductOrd (a1, a2, a3)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3)
-> ProductOrd (a1, a2, a3) -> ProductOrd (a1, a2, a3)
max (ProductOrd (a1
a1, a2
a2, a3
a3)) (ProductOrd (a1
b1, a2
b2, a3
b3))
= (a1, a2, a3) -> ProductOrd (a1, a2, a3)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4)
=> Ord (ProductOrd (a1, a2, a3, a4)) where
ProductOrd (a1, a2, a3, a4)
x > :: ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4) -> Bool
> ProductOrd (a1, a2, a3, a4)
y = (a1, a2, a3, a4) -> (a1, a2, a3, a4) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4)
x (a1, a2, a3, a4)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4)
x < :: ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4) -> Bool
< ProductOrd (a1, a2, a3, a4)
y = (a1, a2, a3, a4) -> (a1, a2, a3, a4) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4)
x (a1, a2, a3, a4)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4) >= :: ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4) <= :: ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4)
-> ProductOrd (a1, a2, a3, a4) -> Ordering
compare (ProductOrd (a1, a2, a3, a4)
a) (ProductOrd (a1, a2, a3, a4)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4) -> (a1, a2, a3, a4) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4)
a (a1, a2, a3, a4)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4)
-> ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4))
= (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4)
-> ProductOrd (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4))
= (a1, a2, a3, a4) -> ProductOrd (a1, a2, a3, a4)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4, Ord a5)
=> Ord (ProductOrd (a1, a2, a3, a4, a5)) where
ProductOrd (a1, a2, a3, a4, a5)
x > :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5) -> Bool
> ProductOrd (a1, a2, a3, a4, a5)
y = (a1, a2, a3, a4, a5) -> (a1, a2, a3, a4, a5) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5)
x (a1, a2, a3, a4, a5)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4, a5)
x < :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5) -> Bool
< ProductOrd (a1, a2, a3, a4, a5)
y = (a1, a2, a3, a4, a5) -> (a1, a2, a3, a4, a5) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5)
x (a1, a2, a3, a4, a5)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5) >= :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
>= a5
b5
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5) <= :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
<= a5
b5
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5) -> Ordering
compare (ProductOrd (a1, a2, a3, a4, a5)
a) (ProductOrd (a1, a2, a3, a4, a5)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4, a5) -> (a1, a2, a3, a4, a5) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5)
a (a1, a2, a3, a4, a5)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5))
= (a1, a2, a3, a4, a5) -> ProductOrd (a1, a2, a3, a4, a5)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
min a5
a5 a5
b5)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5)
-> ProductOrd (a1, a2, a3, a4, a5)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5))
= (a1, a2, a3, a4, a5) -> ProductOrd (a1, a2, a3, a4, a5)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
max a5
a5 a5
b5)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4, Ord a5, Ord a6)
=> Ord (ProductOrd (a1, a2, a3, a4, a5, a6)) where
ProductOrd (a1, a2, a3, a4, a5, a6)
x > :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6) -> Bool
> ProductOrd (a1, a2, a3, a4, a5, a6)
y = (a1, a2, a3, a4, a5, a6)
-> (a1, a2, a3, a4, a5, a6) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6)
x (a1, a2, a3, a4, a5, a6)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4, a5, a6)
x < :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6) -> Bool
< ProductOrd (a1, a2, a3, a4, a5, a6)
y = (a1, a2, a3, a4, a5, a6)
-> (a1, a2, a3, a4, a5, a6) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6)
x (a1, a2, a3, a4, a5, a6)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6) >= :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
>= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
>= a6
b6
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6) <= :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
<= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
<= a6
b6
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6) -> Ordering
compare (ProductOrd (a1, a2, a3, a4, a5, a6)
a) (ProductOrd (a1, a2, a3, a4, a5, a6)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4, a5, a6)
-> (a1, a2, a3, a4, a5, a6) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6)
a (a1, a2, a3, a4, a5, a6)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6))
= (a1, a2, a3, a4, a5, a6) -> ProductOrd (a1, a2, a3, a4, a5, a6)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
min a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
min a6
a6 a6
b6)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6)
-> ProductOrd (a1, a2, a3, a4, a5, a6)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6))
= (a1, a2, a3, a4, a5, a6) -> ProductOrd (a1, a2, a3, a4, a5, a6)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
max a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
max a6
a6 a6
b6)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4, Ord a5, Ord a6, Ord a7)
=> Ord (ProductOrd (a1, a2, a3, a4, a5, a6, a7)) where
ProductOrd (a1, a2, a3, a4, a5, a6, a7)
x > :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7) -> Bool
> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
y = (a1, a2, a3, a4, a5, a6, a7)
-> (a1, a2, a3, a4, a5, a6, a7) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7)
x (a1, a2, a3, a4, a5, a6, a7)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4, a5, a6, a7)
x < :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7) -> Bool
< ProductOrd (a1, a2, a3, a4, a5, a6, a7)
y = (a1, a2, a3, a4, a5, a6, a7)
-> (a1, a2, a3, a4, a5, a6, a7) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7)
x (a1, a2, a3, a4, a5, a6, a7)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7) >= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
>= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
>= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
>= a7
b7
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7) <= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
<= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
<= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
<= a7
b7
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7) -> Ordering
compare (ProductOrd (a1, a2, a3, a4, a5, a6, a7)
a) (ProductOrd (a1, a2, a3, a4, a5, a6, a7)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4, a5, a6, a7)
-> (a1, a2, a3, a4, a5, a6, a7) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7)
a (a1, a2, a3, a4, a5, a6, a7)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7))
= (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
min a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
min a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
min a7
a7 a7
b7)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7))
= (a1, a2, a3, a4, a5, a6, a7)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
max a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
max a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
max a7
a7 a7
b7)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4, Ord a5, Ord a6, Ord a7, Ord a8)
=> Ord (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)) where
ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
x > :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8) -> Bool
> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
y = (a1, a2, a3, a4, a5, a6, a7, a8)
-> (a1, a2, a3, a4, a5, a6, a7, a8) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8)
x (a1, a2, a3, a4, a5, a6, a7, a8)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
x < :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8) -> Bool
< ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
y = (a1, a2, a3, a4, a5, a6, a7, a8)
-> (a1, a2, a3, a4, a5, a6, a7, a8) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8)
x (a1, a2, a3, a4, a5, a6, a7, a8)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8) >= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
>= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
>= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
>= a7
b7 Bool -> Bool -> Bool
&& a8
a8 a8 -> a8 -> Bool
forall a. Ord a => a -> a -> Bool
>= a8
b8
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8) <= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
<= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
<= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
<= a7
b7 Bool -> Bool -> Bool
&& a8
a8 a8 -> a8 -> Bool
forall a. Ord a => a -> a -> Bool
<= a8
b8
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8) -> Ordering
compare (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
a) (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4, a5, a6, a7, a8)
-> (a1, a2, a3, a4, a5, a6, a7, a8) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8)
a (a1, a2, a3, a4, a5, a6, a7, a8)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8))
= (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
min a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
min a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
min a7
a7 a7
b7, a8 -> a8 -> a8
forall a. Ord a => a -> a -> a
min a8
a8 a8
b8)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8))
= (a1, a2, a3, a4, a5, a6, a7, a8)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
max a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
max a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
max a7
a7 a7
b7, a8 -> a8 -> a8
forall a. Ord a => a -> a -> a
max a8
a8 a8
b8)
{-# INLINE max #-}

instance (Ord a1, Ord a2, Ord a3, Ord a4, Ord a5, Ord a6, Ord a7, Ord a8, Ord a9)
=> Ord (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)) where
ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
x > :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool
> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
y = (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8, a9)
x (a1, a2, a3, a4, a5, a6, a7, a8, a9)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
x < :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool
< ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
y = (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8, a9)
x (a1, a2, a3, a4, a5, a6, a7, a8, a9)
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8, a9
a9) >= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool
>= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8, a9
b9)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
>= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
>= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
>= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
>= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
>= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
>= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
>= a7
b7 Bool -> Bool -> Bool
&& a8
a8 a8 -> a8 -> Bool
forall a. Ord a => a -> a -> Bool
>= a8
b8 Bool -> Bool -> Bool
&& a9
a9 a9 -> a9 -> Bool
forall a. Ord a => a -> a -> Bool
>= a9
b9
{-# INLINE (>=) #-}
ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8, a9
a9) <= :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool
<= ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8, a9
b9)
= a1
a1 a1 -> a1 -> Bool
forall a. Ord a => a -> a -> Bool
<= a1
b1 Bool -> Bool -> Bool
&& a2
a2 a2 -> a2 -> Bool
forall a. Ord a => a -> a -> Bool
<= a2
b2 Bool -> Bool -> Bool
&& a3
a3 a3 -> a3 -> Bool
forall a. Ord a => a -> a -> Bool
<= a3
b3 Bool -> Bool -> Bool
&& a4
a4 a4 -> a4 -> Bool
forall a. Ord a => a -> a -> Bool
<= a4
b4 Bool -> Bool -> Bool
&& a5
a5 a5 -> a5 -> Bool
forall a. Ord a => a -> a -> Bool
<= a5
b5 Bool -> Bool -> Bool
&& a6
a6 a6 -> a6 -> Bool
forall a. Ord a => a -> a -> Bool
<= a6
b6 Bool -> Bool -> Bool
&& a7
a7 a7 -> a7 -> Bool
forall a. Ord a => a -> a -> Bool
<= a7
b7 Bool -> Bool -> Bool
&& a8
a8 a8 -> a8 -> Bool
forall a. Ord a => a -> a -> Bool
<= a8
b8 Bool -> Bool -> Bool
&& a9
a9 a9 -> a9 -> Bool
forall a. Ord a => a -> a -> Bool
<= a9
b9
{-# INLINE (<=) #-}
compare :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Ordering
compare (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
a) (ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
b) = PartialOrdering -> Ordering
toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
\$ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp (a1, a2, a3, a4, a5, a6, a7, a8, a9)
a (a1, a2, a3, a4, a5, a6, a7, a8, a9)
b
{-# INLINE compare #-}
min :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
min (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8, a9
a9)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8, a9
b9))
= (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
min a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
min a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
min a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
min a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
min a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
min a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
min a7
a7 a7
b7, a8 -> a8 -> a8
forall a. Ord a => a -> a -> a
min a8
a8 a8
b8, a9 -> a9 -> a9
forall a. Ord a => a -> a -> a
min a9
a9 a9
b9)
{-# INLINE min #-}
max :: ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
max (ProductOrd (a1
a1, a2
a2, a3
a3, a4
a4, a5
a5, a6
a6, a7
a7, a8
a8, a9
a9)) (ProductOrd (a1
b1, a2
b2, a3
b3, a4
b4, a5
b5, a6
b6, a7
b7, a8
b8, a9
b9))
= (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-> ProductOrd (a1, a2, a3, a4, a5, a6, a7, a8, a9)
forall a. a -> ProductOrd a
ProductOrd (a1 -> a1 -> a1
forall a. Ord a => a -> a -> a
max a1
a1 a1
b1, a2 -> a2 -> a2
forall a. Ord a => a -> a -> a
max a2
a2 a2
b2, a3 -> a3 -> a3
forall a. Ord a => a -> a -> a
max a3
a3 a3
b3, a4 -> a4 -> a4
forall a. Ord a => a -> a -> a
max a4
a4 a4
b4, a5 -> a5 -> a5
forall a. Ord a => a -> a -> a
max a5
a5 a5
b5, a6 -> a6 -> a6
forall a. Ord a => a -> a -> a
max a6
a6 a6
b6, a7 -> a7 -> a7
forall a. Ord a => a -> a -> a
max a7
a7 a7
b7, a8 -> a8 -> a8
forall a. Ord a => a -> a -> a
max a8
a8 a8
b8, a9 -> a9 -> a9
forall a. Ord a => a -> a -> a
max a9
a9 a9
b9)
{-# INLINE max #-}

-- | Treat `Incomparable` as error (partial function).
toOrdering :: PartialOrdering -> Ordering
toOrdering :: PartialOrdering -> Ordering
toOrdering PartialOrdering
PLT = Ordering
LT
toOrdering PartialOrdering
PGT = Ordering
GT
toOrdering PartialOrdering
PEQ = Ordering
EQ
toOrdering PartialOrdering
Incomparable = String -> Ordering
forall a. HasCallStack => String -> a
error String
"incomparable items (this is a partial function)"
```