{-# OPTIONS_GHC -Wunused-imports #-}
module Agda.Utils.PartialOrd where
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
data PartialOrdering
= POLT
| POLE
| POEQ
| POGE
| POGT
| POAny
deriving (PartialOrdering -> PartialOrdering -> Bool
(PartialOrdering -> PartialOrdering -> Bool)
-> (PartialOrdering -> PartialOrdering -> Bool)
-> Eq PartialOrdering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PartialOrdering -> PartialOrdering -> Bool
== :: PartialOrdering -> PartialOrdering -> Bool
$c/= :: PartialOrdering -> PartialOrdering -> Bool
/= :: PartialOrdering -> PartialOrdering -> Bool
Eq, Int -> PartialOrdering -> ShowS
[PartialOrdering] -> ShowS
PartialOrdering -> String
(Int -> PartialOrdering -> ShowS)
-> (PartialOrdering -> String)
-> ([PartialOrdering] -> ShowS)
-> Show PartialOrdering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PartialOrdering -> ShowS
showsPrec :: Int -> PartialOrdering -> ShowS
$cshow :: PartialOrdering -> String
show :: PartialOrdering -> String
$cshowList :: [PartialOrdering] -> ShowS
showList :: [PartialOrdering] -> ShowS
Show, Int -> PartialOrdering
PartialOrdering -> Int
PartialOrdering -> [PartialOrdering]
PartialOrdering -> PartialOrdering
PartialOrdering -> PartialOrdering -> [PartialOrdering]
PartialOrdering
-> PartialOrdering -> PartialOrdering -> [PartialOrdering]
(PartialOrdering -> PartialOrdering)
-> (PartialOrdering -> PartialOrdering)
-> (Int -> PartialOrdering)
-> (PartialOrdering -> Int)
-> (PartialOrdering -> [PartialOrdering])
-> (PartialOrdering -> PartialOrdering -> [PartialOrdering])
-> (PartialOrdering -> PartialOrdering -> [PartialOrdering])
-> (PartialOrdering
-> PartialOrdering -> PartialOrdering -> [PartialOrdering])
-> Enum PartialOrdering
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PartialOrdering -> PartialOrdering
succ :: PartialOrdering -> PartialOrdering
$cpred :: PartialOrdering -> PartialOrdering
pred :: PartialOrdering -> PartialOrdering
$ctoEnum :: Int -> PartialOrdering
toEnum :: Int -> PartialOrdering
$cfromEnum :: PartialOrdering -> Int
fromEnum :: PartialOrdering -> Int
$cenumFrom :: PartialOrdering -> [PartialOrdering]
enumFrom :: PartialOrdering -> [PartialOrdering]
$cenumFromThen :: PartialOrdering -> PartialOrdering -> [PartialOrdering]
enumFromThen :: PartialOrdering -> PartialOrdering -> [PartialOrdering]
$cenumFromTo :: PartialOrdering -> PartialOrdering -> [PartialOrdering]
enumFromTo :: PartialOrdering -> PartialOrdering -> [PartialOrdering]
$cenumFromThenTo :: PartialOrdering
-> PartialOrdering -> PartialOrdering -> [PartialOrdering]
enumFromThenTo :: PartialOrdering
-> PartialOrdering -> PartialOrdering -> [PartialOrdering]
Enum, PartialOrdering
PartialOrdering -> PartialOrdering -> Bounded PartialOrdering
forall a. a -> a -> Bounded a
$cminBound :: PartialOrdering
minBound :: PartialOrdering
$cmaxBound :: PartialOrdering
maxBound :: PartialOrdering
Bounded)
leqPO :: PartialOrdering -> PartialOrdering -> Bool
leqPO :: PartialOrdering -> PartialOrdering -> Bool
leqPO PartialOrdering
_ PartialOrdering
POAny = Bool
True
leqPO PartialOrdering
POLT PartialOrdering
POLT = Bool
True
leqPO PartialOrdering
POLT PartialOrdering
POLE = Bool
True
leqPO PartialOrdering
POLE PartialOrdering
POLE = Bool
True
leqPO PartialOrdering
POEQ PartialOrdering
POLE = Bool
True
leqPO PartialOrdering
POEQ PartialOrdering
POEQ = Bool
True
leqPO PartialOrdering
POEQ PartialOrdering
POGE = Bool
True
leqPO PartialOrdering
POGE PartialOrdering
POGE = Bool
True
leqPO PartialOrdering
POGT PartialOrdering
POGT = Bool
True
leqPO PartialOrdering
POGT PartialOrdering
POGE = Bool
True
leqPO PartialOrdering
_ PartialOrdering
_ = Bool
False
oppPO :: PartialOrdering -> PartialOrdering
oppPO :: PartialOrdering -> PartialOrdering
oppPO PartialOrdering
POLT = PartialOrdering
POGT
oppPO PartialOrdering
POLE = PartialOrdering
POGE
oppPO PartialOrdering
POEQ = PartialOrdering
POEQ
oppPO PartialOrdering
POGE = PartialOrdering
POLE
oppPO PartialOrdering
POGT = PartialOrdering
POLT
oppPO PartialOrdering
POAny = PartialOrdering
POAny
orPO :: PartialOrdering -> PartialOrdering -> PartialOrdering
orPO :: PartialOrdering -> PartialOrdering -> PartialOrdering
orPO PartialOrdering
POAny PartialOrdering
_ = PartialOrdering
POAny
orPO PartialOrdering
POLT PartialOrdering
POLT = PartialOrdering
POLT
orPO PartialOrdering
POLT PartialOrdering
POLE = PartialOrdering
POLE
orPO PartialOrdering
POLT PartialOrdering
POEQ = PartialOrdering
POLE
orPO PartialOrdering
POLE PartialOrdering
POLT = PartialOrdering
POLE
orPO PartialOrdering
POLE PartialOrdering
POLE = PartialOrdering
POLE
orPO PartialOrdering
POLE PartialOrdering
POEQ = PartialOrdering
POLE
orPO PartialOrdering
POEQ PartialOrdering
POLT = PartialOrdering
POLE
orPO PartialOrdering
POEQ PartialOrdering
POLE = PartialOrdering
POLE
orPO PartialOrdering
POEQ PartialOrdering
POEQ = PartialOrdering
POEQ
orPO PartialOrdering
POEQ PartialOrdering
POGE = PartialOrdering
POGE
orPO PartialOrdering
POEQ PartialOrdering
POGT = PartialOrdering
POGE
orPO PartialOrdering
POGE PartialOrdering
POEQ = PartialOrdering
POGE
orPO PartialOrdering
POGE PartialOrdering
POGE = PartialOrdering
POGE
orPO PartialOrdering
POGE PartialOrdering
POGT = PartialOrdering
POGE
orPO PartialOrdering
POGT PartialOrdering
POEQ = PartialOrdering
POGE
orPO PartialOrdering
POGT PartialOrdering
POGE = PartialOrdering
POGE
orPO PartialOrdering
POGT PartialOrdering
POGT = PartialOrdering
POGT
orPO PartialOrdering
_ PartialOrdering
_ = PartialOrdering
POAny
seqPO :: PartialOrdering -> PartialOrdering -> PartialOrdering
seqPO :: PartialOrdering -> PartialOrdering -> PartialOrdering
seqPO PartialOrdering
POAny PartialOrdering
_ = PartialOrdering
POAny
seqPO PartialOrdering
POEQ PartialOrdering
p = PartialOrdering
p
seqPO PartialOrdering
POLT PartialOrdering
POLT = PartialOrdering
POLT
seqPO PartialOrdering
POLT PartialOrdering
POLE = PartialOrdering
POLT
seqPO PartialOrdering
POLT PartialOrdering
POEQ = PartialOrdering
POLT
seqPO PartialOrdering
POLE PartialOrdering
POLT = PartialOrdering
POLT
seqPO PartialOrdering
POLE PartialOrdering
POLE = PartialOrdering
POLE
seqPO PartialOrdering
POLE PartialOrdering
POEQ = PartialOrdering
POLE
seqPO PartialOrdering
POGE PartialOrdering
POEQ = PartialOrdering
POGE
seqPO PartialOrdering
POGE PartialOrdering
POGE = PartialOrdering
POGE
seqPO PartialOrdering
POGE PartialOrdering
POGT = PartialOrdering
POGT
seqPO PartialOrdering
POGT PartialOrdering
POEQ = PartialOrdering
POGT
seqPO PartialOrdering
POGT PartialOrdering
POGE = PartialOrdering
POGT
seqPO PartialOrdering
POGT PartialOrdering
POGT = PartialOrdering
POGT
seqPO PartialOrdering
_ PartialOrdering
_ = PartialOrdering
POAny
instance Semigroup PartialOrdering where
<> :: PartialOrdering -> PartialOrdering -> PartialOrdering
(<>) = PartialOrdering -> PartialOrdering -> PartialOrdering
seqPO
instance Monoid PartialOrdering where
mempty :: PartialOrdering
mempty = PartialOrdering
POEQ
mappend :: PartialOrdering -> PartialOrdering -> PartialOrdering
mappend = PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Semigroup a => a -> a -> a
(<>)
fromOrdering :: Ordering -> PartialOrdering
fromOrdering :: Ordering -> PartialOrdering
fromOrdering Ordering
LT = PartialOrdering
POLT
fromOrdering Ordering
EQ = PartialOrdering
POEQ
fromOrdering Ordering
GT = PartialOrdering
POGT
fromOrderings :: [Ordering] -> PartialOrdering
fromOrderings :: [Ordering] -> PartialOrdering
fromOrderings = (PartialOrdering -> PartialOrdering -> PartialOrdering)
-> [PartialOrdering] -> PartialOrdering
forall a. (a -> a -> a) -> [a] -> a
forall (t :: * -> *) a. Foldable t => (a -> a -> a) -> t a -> a
foldr1 PartialOrdering -> PartialOrdering -> PartialOrdering
orPO ([PartialOrdering] -> PartialOrdering)
-> ([Ordering] -> [PartialOrdering])
-> [Ordering]
-> PartialOrdering
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ordering -> PartialOrdering) -> [Ordering] -> [PartialOrdering]
forall a b. (a -> b) -> [a] -> [b]
map Ordering -> PartialOrdering
fromOrdering
toOrderings :: PartialOrdering -> [Ordering]
toOrderings :: PartialOrdering -> [Ordering]
toOrderings PartialOrdering
POLT = [Ordering
LT]
toOrderings PartialOrdering
POLE = [Ordering
LT, Ordering
EQ]
toOrderings PartialOrdering
POEQ = [Ordering
EQ]
toOrderings PartialOrdering
POGE = [Ordering
EQ, Ordering
GT]
toOrderings PartialOrdering
POGT = [Ordering
GT]
toOrderings PartialOrdering
POAny = [Ordering
LT, Ordering
EQ, Ordering
GT]
type Comparable a = a -> a -> PartialOrdering
class PartialOrd a where
comparable :: Comparable a
comparableOrd :: Ord a => Comparable a
comparableOrd :: forall a. Ord a => Comparable a
comparableOrd a
x a
y = Ordering -> PartialOrdering
fromOrdering (Ordering -> PartialOrdering) -> Ordering -> PartialOrdering
forall a b. (a -> b) -> a -> b
$ a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
compare a
x a
y
related :: PartialOrd a => a -> PartialOrdering -> a -> Bool
related :: forall a. PartialOrd a => a -> PartialOrdering -> a -> Bool
related a
a PartialOrdering
o a
b = Comparable a
forall a. PartialOrd a => Comparable a
comparable a
a a
b PartialOrdering -> PartialOrdering -> Bool
`leqPO` PartialOrdering
o
instance PartialOrd Int where
comparable :: Comparable Int
comparable = Comparable Int
forall a. Ord a => Comparable a
comparableOrd
instance PartialOrd Integer where
comparable :: Comparable Integer
comparable = Comparable Integer
forall a. Ord a => Comparable a
comparableOrd
instance PartialOrd () where
comparable :: Comparable ()
comparable ()
_ ()
_ = PartialOrdering
POEQ
instance PartialOrd a => PartialOrd (Maybe a) where
comparable :: Comparable (Maybe a)
comparable Maybe a
mx Maybe a
my = case (Maybe a
mx, Maybe a
my) of
(Maybe a
Nothing, Maybe a
Nothing) -> PartialOrdering
POEQ
(Maybe a
Nothing, Just{} ) -> PartialOrdering
POAny
(Just{} , Maybe a
Nothing) -> PartialOrdering
POAny
(Just a
x , Just a
y ) -> Comparable a
forall a. PartialOrd a => Comparable a
comparable a
x a
y
instance (PartialOrd a, PartialOrd b) => PartialOrd (Either a b) where
comparable :: Comparable (Either a b)
comparable Either a b
mx Either a b
my = case (Either a b
mx, Either a b
my) of
(Left a
x, Left a
y) -> Comparable a
forall a. PartialOrd a => Comparable a
comparable a
x a
y
(Left a
_, Right b
_) -> PartialOrdering
POAny
(Right b
_, Left a
_) -> PartialOrdering
POAny
(Right b
x, Right b
y) -> Comparable b
forall a. PartialOrd a => Comparable a
comparable b
x b
y
instance (PartialOrd a, PartialOrd b) => PartialOrd (a, b) where
comparable :: Comparable (a, b)
comparable (a
x1, b
x2) (a
y1, b
y2) =
Comparable a
forall a. PartialOrd a => Comparable a
comparable a
x1 a
y1 PartialOrdering -> PartialOrdering -> PartialOrdering
`orPO`
Comparable b
forall a. PartialOrd a => Comparable a
comparable b
x2 b
y2
newtype Pointwise a = Pointwise { forall a. Pointwise a -> a
pointwise :: a }
deriving (Pointwise a -> Pointwise a -> Bool
(Pointwise a -> Pointwise a -> Bool)
-> (Pointwise a -> Pointwise a -> Bool) -> Eq (Pointwise a)
forall a. Eq a => Pointwise a -> Pointwise a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Pointwise a -> Pointwise a -> Bool
== :: Pointwise a -> Pointwise a -> Bool
$c/= :: forall a. Eq a => Pointwise a -> Pointwise a -> Bool
/= :: Pointwise a -> Pointwise a -> Bool
Eq, Int -> Pointwise a -> ShowS
[Pointwise a] -> ShowS
Pointwise a -> String
(Int -> Pointwise a -> ShowS)
-> (Pointwise a -> String)
-> ([Pointwise a] -> ShowS)
-> Show (Pointwise a)
forall a. Show a => Int -> Pointwise a -> ShowS
forall a. Show a => [Pointwise a] -> ShowS
forall a. Show a => Pointwise a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Pointwise a -> ShowS
showsPrec :: Int -> Pointwise a -> ShowS
$cshow :: forall a. Show a => Pointwise a -> String
show :: Pointwise a -> String
$cshowList :: forall a. Show a => [Pointwise a] -> ShowS
showList :: [Pointwise a] -> ShowS
Show, (forall a b. (a -> b) -> Pointwise a -> Pointwise b)
-> (forall a b. a -> Pointwise b -> Pointwise a)
-> Functor Pointwise
forall a b. a -> Pointwise b -> Pointwise a
forall a b. (a -> b) -> Pointwise a -> Pointwise b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Pointwise a -> Pointwise b
fmap :: forall a b. (a -> b) -> Pointwise a -> Pointwise b
$c<$ :: forall a b. a -> Pointwise b -> Pointwise a
<$ :: forall a b. a -> Pointwise b -> Pointwise a
Functor)
instance PartialOrd a => PartialOrd (Pointwise [a]) where
comparable :: Comparable (Pointwise [a])
comparable (Pointwise [a]
xs) (Pointwise [a]
ys) = Maybe PartialOrdering -> [a] -> [a] -> PartialOrdering
forall {a}.
PartialOrd a =>
Maybe PartialOrdering -> [a] -> [a] -> PartialOrdering
loop Maybe PartialOrdering
forall a. Maybe a
Nothing [a]
xs [a]
ys
where
loop :: Maybe PartialOrdering -> [a] -> [a] -> PartialOrdering
loop Maybe PartialOrdering
mo [] [] = PartialOrdering -> Maybe PartialOrdering -> PartialOrdering
forall a. a -> Maybe a -> a
fromMaybe PartialOrdering
POEQ Maybe PartialOrdering
mo
loop Maybe PartialOrdering
_ [] [a]
ys = PartialOrdering
POAny
loop Maybe PartialOrdering
_ [a]
xs [] = PartialOrdering
POAny
loop Maybe PartialOrdering
mo (a
x:[a]
xs) (a
y:[a]
ys) =
let o :: PartialOrdering
o = Comparable a
forall a. PartialOrd a => Comparable a
comparable a
x a
y in
case PartialOrdering
-> (PartialOrdering -> PartialOrdering)
-> Maybe PartialOrdering
-> PartialOrdering
forall b a. b -> (a -> b) -> Maybe a -> b
maybe PartialOrdering
o (PartialOrdering -> PartialOrdering -> PartialOrdering
orPO PartialOrdering
o) Maybe PartialOrdering
mo of
PartialOrdering
POAny -> PartialOrdering
POAny
PartialOrdering
o -> Maybe PartialOrdering -> [a] -> [a] -> PartialOrdering
loop (PartialOrdering -> Maybe PartialOrdering
forall a. a -> Maybe a
Just PartialOrdering
o) [a]
xs [a]
ys
newtype Inclusion a = Inclusion { forall a. Inclusion a -> a
inclusion :: a }
deriving (Inclusion a -> Inclusion a -> Bool
(Inclusion a -> Inclusion a -> Bool)
-> (Inclusion a -> Inclusion a -> Bool) -> Eq (Inclusion a)
forall a. Eq a => Inclusion a -> Inclusion a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Inclusion a -> Inclusion a -> Bool
== :: Inclusion a -> Inclusion a -> Bool
$c/= :: forall a. Eq a => Inclusion a -> Inclusion a -> Bool
/= :: Inclusion a -> Inclusion a -> Bool
Eq, Eq (Inclusion a)
Eq (Inclusion a) =>
(Inclusion a -> Inclusion a -> Ordering)
-> (Inclusion a -> Inclusion a -> Bool)
-> (Inclusion a -> Inclusion a -> Bool)
-> (Inclusion a -> Inclusion a -> Bool)
-> (Inclusion a -> Inclusion a -> Bool)
-> (Inclusion a -> Inclusion a -> Inclusion a)
-> (Inclusion a -> Inclusion a -> Inclusion a)
-> Ord (Inclusion a)
Inclusion a -> Inclusion a -> Bool
Inclusion a -> Inclusion a -> Ordering
Inclusion a -> Inclusion a -> Inclusion a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Inclusion a)
forall a. Ord a => Inclusion a -> Inclusion a -> Bool
forall a. Ord a => Inclusion a -> Inclusion a -> Ordering
forall a. Ord a => Inclusion a -> Inclusion a -> Inclusion a
$ccompare :: forall a. Ord a => Inclusion a -> Inclusion a -> Ordering
compare :: Inclusion a -> Inclusion a -> Ordering
$c< :: forall a. Ord a => Inclusion a -> Inclusion a -> Bool
< :: Inclusion a -> Inclusion a -> Bool
$c<= :: forall a. Ord a => Inclusion a -> Inclusion a -> Bool
<= :: Inclusion a -> Inclusion a -> Bool
$c> :: forall a. Ord a => Inclusion a -> Inclusion a -> Bool
> :: Inclusion a -> Inclusion a -> Bool
$c>= :: forall a. Ord a => Inclusion a -> Inclusion a -> Bool
>= :: Inclusion a -> Inclusion a -> Bool
$cmax :: forall a. Ord a => Inclusion a -> Inclusion a -> Inclusion a
max :: Inclusion a -> Inclusion a -> Inclusion a
$cmin :: forall a. Ord a => Inclusion a -> Inclusion a -> Inclusion a
min :: Inclusion a -> Inclusion a -> Inclusion a
Ord, Int -> Inclusion a -> ShowS
[Inclusion a] -> ShowS
Inclusion a -> String
(Int -> Inclusion a -> ShowS)
-> (Inclusion a -> String)
-> ([Inclusion a] -> ShowS)
-> Show (Inclusion a)
forall a. Show a => Int -> Inclusion a -> ShowS
forall a. Show a => [Inclusion a] -> ShowS
forall a. Show a => Inclusion a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Inclusion a -> ShowS
showsPrec :: Int -> Inclusion a -> ShowS
$cshow :: forall a. Show a => Inclusion a -> String
show :: Inclusion a -> String
$cshowList :: forall a. Show a => [Inclusion a] -> ShowS
showList :: [Inclusion a] -> ShowS
Show, (forall a b. (a -> b) -> Inclusion a -> Inclusion b)
-> (forall a b. a -> Inclusion b -> Inclusion a)
-> Functor Inclusion
forall a b. a -> Inclusion b -> Inclusion a
forall a b. (a -> b) -> Inclusion a -> Inclusion b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Inclusion a -> Inclusion b
fmap :: forall a b. (a -> b) -> Inclusion a -> Inclusion b
$c<$ :: forall a b. a -> Inclusion b -> Inclusion a
<$ :: forall a b. a -> Inclusion b -> Inclusion a
Functor)
instance (Ord a) => PartialOrd (Inclusion [a]) where
comparable :: Comparable (Inclusion [a])
comparable (Inclusion [a]
xs) (Inclusion [a]
ys) = PartialOrdering -> [a] -> [a] -> PartialOrdering
forall {a}.
Ord a =>
PartialOrdering -> [a] -> [a] -> PartialOrdering
merge PartialOrdering
POEQ [a]
xs [a]
ys
where
merge' :: PartialOrdering -> [a] -> [a] -> PartialOrdering
merge' PartialOrdering
POAny [a]
xs [a]
ys = PartialOrdering
POAny
merge' PartialOrdering
o [a]
xs [a]
ys = PartialOrdering -> [a] -> [a] -> PartialOrdering
merge PartialOrdering
o [a]
xs [a]
ys
merge :: PartialOrdering -> [a] -> [a] -> PartialOrdering
merge PartialOrdering
o [] [] = PartialOrdering
o
merge PartialOrdering
o [] [a]
ys = PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Monoid a => a -> a -> a
mappend PartialOrdering
o PartialOrdering
POLT
merge PartialOrdering
o [a]
xs [] = PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Monoid a => a -> a -> a
mappend PartialOrdering
o PartialOrdering
POGT
merge PartialOrdering
o xs :: [a]
xs@(a
x:[a]
xs') ys :: [a]
ys@(a
y:[a]
ys') =
case a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
compare a
x a
y of
Ordering
LT -> PartialOrdering -> [a] -> [a] -> PartialOrdering
merge' (PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Monoid a => a -> a -> a
mappend PartialOrdering
o PartialOrdering
POGT) [a]
xs' [a]
ys
Ordering
EQ -> PartialOrdering -> [a] -> [a] -> PartialOrdering
merge PartialOrdering
o [a]
xs' [a]
ys'
Ordering
GT -> PartialOrdering -> [a] -> [a] -> PartialOrdering
merge' (PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Monoid a => a -> a -> a
mappend PartialOrdering
o PartialOrdering
POLT) [a]
xs [a]
ys'
instance Ord a => PartialOrd (Inclusion (Set a)) where
comparable :: Comparable (Inclusion (Set a))
comparable Inclusion (Set a)
s Inclusion (Set a)
t = Comparable (Inclusion [a])
forall a. PartialOrd a => Comparable a
comparable (Set a -> [a]
forall a. Set a -> [a]
Set.toAscList (Set a -> [a]) -> Inclusion (Set a) -> Inclusion [a]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Inclusion (Set a)
s) (Set a -> [a]
forall a. Set a -> [a]
Set.toAscList (Set a -> [a]) -> Inclusion (Set a) -> Inclusion [a]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Inclusion (Set a)
t)
instance PartialOrd PartialOrdering where
comparable :: PartialOrdering -> PartialOrdering -> PartialOrdering
comparable PartialOrdering
POAny PartialOrdering
POAny = PartialOrdering
POEQ
comparable PartialOrdering
POAny PartialOrdering
_ = PartialOrdering
POGT
comparable PartialOrdering
_ PartialOrdering
POAny = PartialOrdering
POLT
comparable PartialOrdering
POLE PartialOrdering
POLE = PartialOrdering
POEQ
comparable PartialOrdering
POLE PartialOrdering
POLT = PartialOrdering
POGT
comparable PartialOrdering
POLE PartialOrdering
POEQ = PartialOrdering
POGT
comparable PartialOrdering
POGE PartialOrdering
POGE = PartialOrdering
POEQ
comparable PartialOrdering
POGE PartialOrdering
POGT = PartialOrdering
POGT
comparable PartialOrdering
POGE PartialOrdering
POEQ = PartialOrdering
POGT
comparable PartialOrdering
POLT PartialOrdering
POLT = PartialOrdering
POEQ
comparable PartialOrdering
POLT PartialOrdering
POLE = PartialOrdering
POLT
comparable PartialOrdering
POEQ PartialOrdering
POEQ = PartialOrdering
POEQ
comparable PartialOrdering
POEQ PartialOrdering
POLE = PartialOrdering
POLT
comparable PartialOrdering
POEQ PartialOrdering
POGE = PartialOrdering
POLT
comparable PartialOrdering
POGT PartialOrdering
POGT = PartialOrdering
POEQ
comparable PartialOrdering
POGT PartialOrdering
POGE = PartialOrdering
POLT
comparable PartialOrdering
_ PartialOrdering
_ = PartialOrdering
POAny