{-# LANGUAGE DeriveTraversable, GeneralizedNewtypeDeriving #-}
module Data.Semilattice.Join
( Join(..)
, Joining(..)
, LessThan(..)
) where
import Data.HashMap.Lazy as HashMap
import Data.HashSet as HashSet
import Data.IntMap as IntMap
import Data.IntSet as IntSet
import Data.Map as Map
import Data.Semigroup
import Data.Semilattice.Lower
import Data.Set as Set
class Join s where
(\/) :: s -> s -> s
infixr 6 \/
instance Join () where
()
_ \/ :: () -> () -> ()
\/ ()
_ = ()
instance Join Bool where
\/ :: Bool -> Bool -> Bool
(\/) = Bool -> Bool -> Bool
(||)
instance Join Ordering where
Ordering
GT \/ :: Ordering -> Ordering -> Ordering
\/ Ordering
_ = Ordering
GT
Ordering
_ \/ Ordering
GT = Ordering
GT
Ordering
LT \/ Ordering
b = Ordering
b
Ordering
a \/ Ordering
LT = Ordering
a
Ordering
_ \/ Ordering
_ = Ordering
EQ
instance Join b => Join (a -> b) where
a -> b
f \/ :: (a -> b) -> (a -> b) -> a -> b
\/ a -> b
g = b -> b -> b
forall s. Join s => s -> s -> s
(\/) (b -> b -> b) -> (a -> b) -> a -> b -> b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> b
f (a -> b -> b) -> (a -> b) -> a -> b
forall a b. (a -> a -> b) -> (a -> a) -> a -> b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a -> b
g
instance Ord a => Join (Max a) where
\/ :: Max a -> Max a -> Max a
(\/) = Max a -> Max a -> Max a
forall a. Semigroup a => a -> a -> a
(<>)
instance Join a => Join (IntMap a) where
\/ :: IntMap a -> IntMap a -> IntMap a
(\/) = (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a
forall a. (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a
IntMap.unionWith a -> a -> a
forall s. Join s => s -> s -> s
(\/)
instance Join IntSet where
\/ :: IntSet -> IntSet -> IntSet
(\/) = IntSet -> IntSet -> IntSet
IntSet.union
instance (Ord k, Join a) => Join (Map k a) where
\/ :: Map k a -> Map k a -> Map k a
(\/) = (a -> a -> a) -> Map k a -> Map k a -> Map k a
forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
Map.unionWith a -> a -> a
forall s. Join s => s -> s -> s
(\/)
instance Ord a => Join (Set a) where
\/ :: Set a -> Set a -> Set a
(\/) = Set a -> Set a -> Set a
forall a. Ord a => Set a -> Set a -> Set a
Set.union
instance (Eq k, Join a) => Join (HashMap k a) where
\/ :: HashMap k a -> HashMap k a -> HashMap k a
(\/) = (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a
forall k v.
Eq k =>
(v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
HashMap.unionWith a -> a -> a
forall s. Join s => s -> s -> s
(\/)
instance Eq a => Join (HashSet a) where
\/ :: HashSet a -> HashSet a -> HashSet a
(\/) = HashSet a -> HashSet a -> HashSet a
forall a. Eq a => HashSet a -> HashSet a -> HashSet a
HashSet.union
newtype Joining a = Joining { forall a. Joining a -> a
getJoining :: a }
deriving (Joining a
Joining a -> Joining a -> Bounded (Joining a)
forall a. a -> a -> Bounded a
forall a. Bounded a => Joining a
$cminBound :: forall a. Bounded a => Joining a
minBound :: Joining a
$cmaxBound :: forall a. Bounded a => Joining a
maxBound :: Joining a
Bounded, Int -> Joining a
Joining a -> Int
Joining a -> [Joining a]
Joining a -> Joining a
Joining a -> Joining a -> [Joining a]
Joining a -> Joining a -> Joining a -> [Joining a]
(Joining a -> Joining a)
-> (Joining a -> Joining a)
-> (Int -> Joining a)
-> (Joining a -> Int)
-> (Joining a -> [Joining a])
-> (Joining a -> Joining a -> [Joining a])
-> (Joining a -> Joining a -> [Joining a])
-> (Joining a -> Joining a -> Joining a -> [Joining a])
-> Enum (Joining a)
forall a. Enum a => Int -> Joining a
forall a. Enum a => Joining a -> Int
forall a. Enum a => Joining a -> [Joining a]
forall a. Enum a => Joining a -> Joining a
forall a. Enum a => Joining a -> Joining a -> [Joining a]
forall a.
Enum a =>
Joining a -> Joining a -> Joining a -> [Joining 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
$csucc :: forall a. Enum a => Joining a -> Joining a
succ :: Joining a -> Joining a
$cpred :: forall a. Enum a => Joining a -> Joining a
pred :: Joining a -> Joining a
$ctoEnum :: forall a. Enum a => Int -> Joining a
toEnum :: Int -> Joining a
$cfromEnum :: forall a. Enum a => Joining a -> Int
fromEnum :: Joining a -> Int
$cenumFrom :: forall a. Enum a => Joining a -> [Joining a]
enumFrom :: Joining a -> [Joining a]
$cenumFromThen :: forall a. Enum a => Joining a -> Joining a -> [Joining a]
enumFromThen :: Joining a -> Joining a -> [Joining a]
$cenumFromTo :: forall a. Enum a => Joining a -> Joining a -> [Joining a]
enumFromTo :: Joining a -> Joining a -> [Joining a]
$cenumFromThenTo :: forall a.
Enum a =>
Joining a -> Joining a -> Joining a -> [Joining a]
enumFromThenTo :: Joining a -> Joining a -> Joining a -> [Joining a]
Enum, Joining a -> Joining a -> Bool
(Joining a -> Joining a -> Bool)
-> (Joining a -> Joining a -> Bool) -> Eq (Joining a)
forall a. Eq a => Joining a -> Joining a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Joining a -> Joining a -> Bool
== :: Joining a -> Joining a -> Bool
$c/= :: forall a. Eq a => Joining a -> Joining a -> Bool
/= :: Joining a -> Joining a -> Bool
Eq, (forall m. Monoid m => Joining m -> m)
-> (forall m a. Monoid m => (a -> m) -> Joining a -> m)
-> (forall m a. Monoid m => (a -> m) -> Joining a -> m)
-> (forall a b. (a -> b -> b) -> b -> Joining a -> b)
-> (forall a b. (a -> b -> b) -> b -> Joining a -> b)
-> (forall b a. (b -> a -> b) -> b -> Joining a -> b)
-> (forall b a. (b -> a -> b) -> b -> Joining a -> b)
-> (forall a. (a -> a -> a) -> Joining a -> a)
-> (forall a. (a -> a -> a) -> Joining a -> a)
-> (forall a. Joining a -> [a])
-> (forall a. Joining a -> Bool)
-> (forall a. Joining a -> Int)
-> (forall a. Eq a => a -> Joining a -> Bool)
-> (forall a. Ord a => Joining a -> a)
-> (forall a. Ord a => Joining a -> a)
-> (forall a. Num a => Joining a -> a)
-> (forall a. Num a => Joining a -> a)
-> Foldable Joining
forall a. Eq a => a -> Joining a -> Bool
forall a. Num a => Joining a -> a
forall a. Ord a => Joining a -> a
forall m. Monoid m => Joining m -> m
forall a. Joining a -> Bool
forall a. Joining a -> Int
forall a. Joining a -> [a]
forall a. (a -> a -> a) -> Joining a -> a
forall m a. Monoid m => (a -> m) -> Joining a -> m
forall b a. (b -> a -> b) -> b -> Joining a -> b
forall a b. (a -> b -> b) -> b -> Joining a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Joining m -> m
fold :: forall m. Monoid m => Joining m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Joining a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Joining a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Joining a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Joining a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Joining a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Joining a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Joining a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Joining a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Joining a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Joining a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Joining a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Joining a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Joining a -> a
foldr1 :: forall a. (a -> a -> a) -> Joining a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Joining a -> a
foldl1 :: forall a. (a -> a -> a) -> Joining a -> a
$ctoList :: forall a. Joining a -> [a]
toList :: forall a. Joining a -> [a]
$cnull :: forall a. Joining a -> Bool
null :: forall a. Joining a -> Bool
$clength :: forall a. Joining a -> Int
length :: forall a. Joining a -> Int
$celem :: forall a. Eq a => a -> Joining a -> Bool
elem :: forall a. Eq a => a -> Joining a -> Bool
$cmaximum :: forall a. Ord a => Joining a -> a
maximum :: forall a. Ord a => Joining a -> a
$cminimum :: forall a. Ord a => Joining a -> a
minimum :: forall a. Ord a => Joining a -> a
$csum :: forall a. Num a => Joining a -> a
sum :: forall a. Num a => Joining a -> a
$cproduct :: forall a. Num a => Joining a -> a
product :: forall a. Num a => Joining a -> a
Foldable, (forall a b. (a -> b) -> Joining a -> Joining b)
-> (forall a b. a -> Joining b -> Joining a) -> Functor Joining
forall a b. a -> Joining b -> Joining a
forall a b. (a -> b) -> Joining a -> Joining 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) -> Joining a -> Joining b
fmap :: forall a b. (a -> b) -> Joining a -> Joining b
$c<$ :: forall a b. a -> Joining b -> Joining a
<$ :: forall a b. a -> Joining b -> Joining a
Functor, Joining a -> Joining a -> Joining a
(Joining a -> Joining a -> Joining a) -> Join (Joining a)
forall a. Join a => Joining a -> Joining a -> Joining a
forall s. (s -> s -> s) -> Join s
$c\/ :: forall a. Join a => Joining a -> Joining a -> Joining a
\/ :: Joining a -> Joining a -> Joining a
Join, Joining a
Joining a -> Lower (Joining a)
forall s. s -> Lower s
forall a. Lower a => Joining a
$clowerBound :: forall a. Lower a => Joining a
lowerBound :: Joining a
Lower, Integer -> Joining a
Joining a -> Joining a
Joining a -> Joining a -> Joining a
(Joining a -> Joining a -> Joining a)
-> (Joining a -> Joining a -> Joining a)
-> (Joining a -> Joining a -> Joining a)
-> (Joining a -> Joining a)
-> (Joining a -> Joining a)
-> (Joining a -> Joining a)
-> (Integer -> Joining a)
-> Num (Joining a)
forall a. Num a => Integer -> Joining a
forall a. Num a => Joining a -> Joining a
forall a. Num a => Joining a -> Joining a -> Joining a
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: forall a. Num a => Joining a -> Joining a -> Joining a
+ :: Joining a -> Joining a -> Joining a
$c- :: forall a. Num a => Joining a -> Joining a -> Joining a
- :: Joining a -> Joining a -> Joining a
$c* :: forall a. Num a => Joining a -> Joining a -> Joining a
* :: Joining a -> Joining a -> Joining a
$cnegate :: forall a. Num a => Joining a -> Joining a
negate :: Joining a -> Joining a
$cabs :: forall a. Num a => Joining a -> Joining a
abs :: Joining a -> Joining a
$csignum :: forall a. Num a => Joining a -> Joining a
signum :: Joining a -> Joining a
$cfromInteger :: forall a. Num a => Integer -> Joining a
fromInteger :: Integer -> Joining a
Num, Eq (Joining a)
Eq (Joining a)
-> (Joining a -> Joining a -> Ordering)
-> (Joining a -> Joining a -> Bool)
-> (Joining a -> Joining a -> Bool)
-> (Joining a -> Joining a -> Bool)
-> (Joining a -> Joining a -> Bool)
-> (Joining a -> Joining a -> Joining a)
-> (Joining a -> Joining a -> Joining a)
-> Ord (Joining a)
Joining a -> Joining a -> Bool
Joining a -> Joining a -> Ordering
Joining a -> Joining a -> Joining 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 (Joining a)
forall a. Ord a => Joining a -> Joining a -> Bool
forall a. Ord a => Joining a -> Joining a -> Ordering
forall a. Ord a => Joining a -> Joining a -> Joining a
$ccompare :: forall a. Ord a => Joining a -> Joining a -> Ordering
compare :: Joining a -> Joining a -> Ordering
$c< :: forall a. Ord a => Joining a -> Joining a -> Bool
< :: Joining a -> Joining a -> Bool
$c<= :: forall a. Ord a => Joining a -> Joining a -> Bool
<= :: Joining a -> Joining a -> Bool
$c> :: forall a. Ord a => Joining a -> Joining a -> Bool
> :: Joining a -> Joining a -> Bool
$c>= :: forall a. Ord a => Joining a -> Joining a -> Bool
>= :: Joining a -> Joining a -> Bool
$cmax :: forall a. Ord a => Joining a -> Joining a -> Joining a
max :: Joining a -> Joining a -> Joining a
$cmin :: forall a. Ord a => Joining a -> Joining a -> Joining a
min :: Joining a -> Joining a -> Joining a
Ord, ReadPrec [Joining a]
ReadPrec (Joining a)
Int -> ReadS (Joining a)
ReadS [Joining a]
(Int -> ReadS (Joining a))
-> ReadS [Joining a]
-> ReadPrec (Joining a)
-> ReadPrec [Joining a]
-> Read (Joining a)
forall a. Read a => ReadPrec [Joining a]
forall a. Read a => ReadPrec (Joining a)
forall a. Read a => Int -> ReadS (Joining a)
forall a. Read a => ReadS [Joining a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Joining a)
readsPrec :: Int -> ReadS (Joining a)
$creadList :: forall a. Read a => ReadS [Joining a]
readList :: ReadS [Joining a]
$creadPrec :: forall a. Read a => ReadPrec (Joining a)
readPrec :: ReadPrec (Joining a)
$creadListPrec :: forall a. Read a => ReadPrec [Joining a]
readListPrec :: ReadPrec [Joining a]
Read, Int -> Joining a -> ShowS
[Joining a] -> ShowS
Joining a -> String
(Int -> Joining a -> ShowS)
-> (Joining a -> String)
-> ([Joining a] -> ShowS)
-> Show (Joining a)
forall a. Show a => Int -> Joining a -> ShowS
forall a. Show a => [Joining a] -> ShowS
forall a. Show a => Joining a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Joining a -> ShowS
showsPrec :: Int -> Joining a -> ShowS
$cshow :: forall a. Show a => Joining a -> String
show :: Joining a -> String
$cshowList :: forall a. Show a => [Joining a] -> ShowS
showList :: [Joining a] -> ShowS
Show, Functor Joining
Foldable Joining
Functor Joining
-> Foldable Joining
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Joining a -> f (Joining b))
-> (forall (f :: * -> *) a.
Applicative f =>
Joining (f a) -> f (Joining a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Joining a -> m (Joining b))
-> (forall (m :: * -> *) a.
Monad m =>
Joining (m a) -> m (Joining a))
-> Traversable Joining
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.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Joining (m a) -> m (Joining a)
forall (f :: * -> *) a.
Applicative f =>
Joining (f a) -> f (Joining a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Joining a -> m (Joining b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Joining a -> f (Joining b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Joining a -> f (Joining b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Joining a -> f (Joining b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Joining (f a) -> f (Joining a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Joining (f a) -> f (Joining a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Joining a -> m (Joining b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Joining a -> m (Joining b)
$csequence :: forall (m :: * -> *) a. Monad m => Joining (m a) -> m (Joining a)
sequence :: forall (m :: * -> *) a. Monad m => Joining (m a) -> m (Joining a)
Traversable)
instance Join a => Semigroup (Joining a) where
<> :: Joining a -> Joining a -> Joining a
(<>) = Joining a -> Joining a -> Joining a
forall s. Join s => s -> s -> s
(\/)
instance (Lower a, Join a) => Monoid (Joining a) where
mappend :: Joining a -> Joining a -> Joining a
mappend = Joining a -> Joining a -> Joining a
forall a. Semigroup a => a -> a -> a
(<>)
mempty :: Joining a
mempty = Joining a
forall s. Lower s => s
lowerBound
newtype LessThan a = LessThan { forall a. LessThan a -> a
getLessThan :: a }
deriving (Int -> LessThan a
LessThan a -> Int
LessThan a -> [LessThan a]
LessThan a -> LessThan a
LessThan a -> LessThan a -> [LessThan a]
LessThan a -> LessThan a -> LessThan a -> [LessThan a]
(LessThan a -> LessThan a)
-> (LessThan a -> LessThan a)
-> (Int -> LessThan a)
-> (LessThan a -> Int)
-> (LessThan a -> [LessThan a])
-> (LessThan a -> LessThan a -> [LessThan a])
-> (LessThan a -> LessThan a -> [LessThan a])
-> (LessThan a -> LessThan a -> LessThan a -> [LessThan a])
-> Enum (LessThan a)
forall a. Enum a => Int -> LessThan a
forall a. Enum a => LessThan a -> Int
forall a. Enum a => LessThan a -> [LessThan a]
forall a. Enum a => LessThan a -> LessThan a
forall a. Enum a => LessThan a -> LessThan a -> [LessThan a]
forall a.
Enum a =>
LessThan a -> LessThan a -> LessThan a -> [LessThan 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
$csucc :: forall a. Enum a => LessThan a -> LessThan a
succ :: LessThan a -> LessThan a
$cpred :: forall a. Enum a => LessThan a -> LessThan a
pred :: LessThan a -> LessThan a
$ctoEnum :: forall a. Enum a => Int -> LessThan a
toEnum :: Int -> LessThan a
$cfromEnum :: forall a. Enum a => LessThan a -> Int
fromEnum :: LessThan a -> Int
$cenumFrom :: forall a. Enum a => LessThan a -> [LessThan a]
enumFrom :: LessThan a -> [LessThan a]
$cenumFromThen :: forall a. Enum a => LessThan a -> LessThan a -> [LessThan a]
enumFromThen :: LessThan a -> LessThan a -> [LessThan a]
$cenumFromTo :: forall a. Enum a => LessThan a -> LessThan a -> [LessThan a]
enumFromTo :: LessThan a -> LessThan a -> [LessThan a]
$cenumFromThenTo :: forall a.
Enum a =>
LessThan a -> LessThan a -> LessThan a -> [LessThan a]
enumFromThenTo :: LessThan a -> LessThan a -> LessThan a -> [LessThan a]
Enum, LessThan a -> LessThan a -> Bool
(LessThan a -> LessThan a -> Bool)
-> (LessThan a -> LessThan a -> Bool) -> Eq (LessThan a)
forall a. Eq a => LessThan a -> LessThan a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => LessThan a -> LessThan a -> Bool
== :: LessThan a -> LessThan a -> Bool
$c/= :: forall a. Eq a => LessThan a -> LessThan a -> Bool
/= :: LessThan a -> LessThan a -> Bool
Eq, (forall m. Monoid m => LessThan m -> m)
-> (forall m a. Monoid m => (a -> m) -> LessThan a -> m)
-> (forall m a. Monoid m => (a -> m) -> LessThan a -> m)
-> (forall a b. (a -> b -> b) -> b -> LessThan a -> b)
-> (forall a b. (a -> b -> b) -> b -> LessThan a -> b)
-> (forall b a. (b -> a -> b) -> b -> LessThan a -> b)
-> (forall b a. (b -> a -> b) -> b -> LessThan a -> b)
-> (forall a. (a -> a -> a) -> LessThan a -> a)
-> (forall a. (a -> a -> a) -> LessThan a -> a)
-> (forall a. LessThan a -> [a])
-> (forall a. LessThan a -> Bool)
-> (forall a. LessThan a -> Int)
-> (forall a. Eq a => a -> LessThan a -> Bool)
-> (forall a. Ord a => LessThan a -> a)
-> (forall a. Ord a => LessThan a -> a)
-> (forall a. Num a => LessThan a -> a)
-> (forall a. Num a => LessThan a -> a)
-> Foldable LessThan
forall a. Eq a => a -> LessThan a -> Bool
forall a. Num a => LessThan a -> a
forall a. Ord a => LessThan a -> a
forall m. Monoid m => LessThan m -> m
forall a. LessThan a -> Bool
forall a. LessThan a -> Int
forall a. LessThan a -> [a]
forall a. (a -> a -> a) -> LessThan a -> a
forall m a. Monoid m => (a -> m) -> LessThan a -> m
forall b a. (b -> a -> b) -> b -> LessThan a -> b
forall a b. (a -> b -> b) -> b -> LessThan a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => LessThan m -> m
fold :: forall m. Monoid m => LessThan m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> LessThan a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> LessThan a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> LessThan a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> LessThan a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> LessThan a -> b
foldr :: forall a b. (a -> b -> b) -> b -> LessThan a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> LessThan a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> LessThan a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> LessThan a -> b
foldl :: forall b a. (b -> a -> b) -> b -> LessThan a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> LessThan a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> LessThan a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> LessThan a -> a
foldr1 :: forall a. (a -> a -> a) -> LessThan a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> LessThan a -> a
foldl1 :: forall a. (a -> a -> a) -> LessThan a -> a
$ctoList :: forall a. LessThan a -> [a]
toList :: forall a. LessThan a -> [a]
$cnull :: forall a. LessThan a -> Bool
null :: forall a. LessThan a -> Bool
$clength :: forall a. LessThan a -> Int
length :: forall a. LessThan a -> Int
$celem :: forall a. Eq a => a -> LessThan a -> Bool
elem :: forall a. Eq a => a -> LessThan a -> Bool
$cmaximum :: forall a. Ord a => LessThan a -> a
maximum :: forall a. Ord a => LessThan a -> a
$cminimum :: forall a. Ord a => LessThan a -> a
minimum :: forall a. Ord a => LessThan a -> a
$csum :: forall a. Num a => LessThan a -> a
sum :: forall a. Num a => LessThan a -> a
$cproduct :: forall a. Num a => LessThan a -> a
product :: forall a. Num a => LessThan a -> a
Foldable, (forall a b. (a -> b) -> LessThan a -> LessThan b)
-> (forall a b. a -> LessThan b -> LessThan a) -> Functor LessThan
forall a b. a -> LessThan b -> LessThan a
forall a b. (a -> b) -> LessThan a -> LessThan 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) -> LessThan a -> LessThan b
fmap :: forall a b. (a -> b) -> LessThan a -> LessThan b
$c<$ :: forall a b. a -> LessThan b -> LessThan a
<$ :: forall a b. a -> LessThan b -> LessThan a
Functor, LessThan a -> LessThan a -> LessThan a
(LessThan a -> LessThan a -> LessThan a) -> Join (LessThan a)
forall a. Join a => LessThan a -> LessThan a -> LessThan a
forall s. (s -> s -> s) -> Join s
$c\/ :: forall a. Join a => LessThan a -> LessThan a -> LessThan a
\/ :: LessThan a -> LessThan a -> LessThan a
Join, Integer -> LessThan a
LessThan a -> LessThan a
LessThan a -> LessThan a -> LessThan a
(LessThan a -> LessThan a -> LessThan a)
-> (LessThan a -> LessThan a -> LessThan a)
-> (LessThan a -> LessThan a -> LessThan a)
-> (LessThan a -> LessThan a)
-> (LessThan a -> LessThan a)
-> (LessThan a -> LessThan a)
-> (Integer -> LessThan a)
-> Num (LessThan a)
forall a. Num a => Integer -> LessThan a
forall a. Num a => LessThan a -> LessThan a
forall a. Num a => LessThan a -> LessThan a -> LessThan a
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: forall a. Num a => LessThan a -> LessThan a -> LessThan a
+ :: LessThan a -> LessThan a -> LessThan a
$c- :: forall a. Num a => LessThan a -> LessThan a -> LessThan a
- :: LessThan a -> LessThan a -> LessThan a
$c* :: forall a. Num a => LessThan a -> LessThan a -> LessThan a
* :: LessThan a -> LessThan a -> LessThan a
$cnegate :: forall a. Num a => LessThan a -> LessThan a
negate :: LessThan a -> LessThan a
$cabs :: forall a. Num a => LessThan a -> LessThan a
abs :: LessThan a -> LessThan a
$csignum :: forall a. Num a => LessThan a -> LessThan a
signum :: LessThan a -> LessThan a
$cfromInteger :: forall a. Num a => Integer -> LessThan a
fromInteger :: Integer -> LessThan a
Num, ReadPrec [LessThan a]
ReadPrec (LessThan a)
Int -> ReadS (LessThan a)
ReadS [LessThan a]
(Int -> ReadS (LessThan a))
-> ReadS [LessThan a]
-> ReadPrec (LessThan a)
-> ReadPrec [LessThan a]
-> Read (LessThan a)
forall a. Read a => ReadPrec [LessThan a]
forall a. Read a => ReadPrec (LessThan a)
forall a. Read a => Int -> ReadS (LessThan a)
forall a. Read a => ReadS [LessThan a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (LessThan a)
readsPrec :: Int -> ReadS (LessThan a)
$creadList :: forall a. Read a => ReadS [LessThan a]
readList :: ReadS [LessThan a]
$creadPrec :: forall a. Read a => ReadPrec (LessThan a)
readPrec :: ReadPrec (LessThan a)
$creadListPrec :: forall a. Read a => ReadPrec [LessThan a]
readListPrec :: ReadPrec [LessThan a]
Read, Int -> LessThan a -> ShowS
[LessThan a] -> ShowS
LessThan a -> String
(Int -> LessThan a -> ShowS)
-> (LessThan a -> String)
-> ([LessThan a] -> ShowS)
-> Show (LessThan a)
forall a. Show a => Int -> LessThan a -> ShowS
forall a. Show a => [LessThan a] -> ShowS
forall a. Show a => LessThan a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> LessThan a -> ShowS
showsPrec :: Int -> LessThan a -> ShowS
$cshow :: forall a. Show a => LessThan a -> String
show :: LessThan a -> String
$cshowList :: forall a. Show a => [LessThan a] -> ShowS
showList :: [LessThan a] -> ShowS
Show, Functor LessThan
Foldable LessThan
Functor LessThan
-> Foldable LessThan
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LessThan a -> f (LessThan b))
-> (forall (f :: * -> *) a.
Applicative f =>
LessThan (f a) -> f (LessThan a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LessThan a -> m (LessThan b))
-> (forall (m :: * -> *) a.
Monad m =>
LessThan (m a) -> m (LessThan a))
-> Traversable LessThan
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.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => LessThan (m a) -> m (LessThan a)
forall (f :: * -> *) a.
Applicative f =>
LessThan (f a) -> f (LessThan a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LessThan a -> m (LessThan b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LessThan a -> f (LessThan b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LessThan a -> f (LessThan b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LessThan a -> f (LessThan b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
LessThan (f a) -> f (LessThan a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
LessThan (f a) -> f (LessThan a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LessThan a -> m (LessThan b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LessThan a -> m (LessThan b)
$csequence :: forall (m :: * -> *) a. Monad m => LessThan (m a) -> m (LessThan a)
sequence :: forall (m :: * -> *) a. Monad m => LessThan (m a) -> m (LessThan a)
Traversable)
instance (Eq a, Join a) => Ord (LessThan a) where
compare :: LessThan a -> LessThan a -> Ordering
compare LessThan a
a LessThan a
b
| LessThan a
a LessThan a -> LessThan a -> Bool
forall a. Eq a => a -> a -> Bool
== LessThan a
b = Ordering
EQ
| LessThan a
a LessThan a -> LessThan a -> LessThan a
forall s. Join s => s -> s -> s
\/ LessThan a
b LessThan a -> LessThan a -> Bool
forall a. Eq a => a -> a -> Bool
== LessThan a
b = Ordering
LT
| Bool
otherwise = Ordering
GT
LessThan a
a <= :: LessThan a -> LessThan a -> Bool
<= LessThan a
b = LessThan a
a LessThan a -> LessThan a -> LessThan a
forall s. Join s => s -> s -> s
\/ LessThan a
b LessThan a -> LessThan a -> Bool
forall a. Eq a => a -> a -> Bool
== LessThan a
b