Safe Haskell | None |
---|---|
Language | Haskell2010 |
Join semilattices, related to Lower
and Upper
.
Synopsis
- class Join s where
- newtype Joining a = Joining {
- getJoining :: a
- newtype LessThan a = LessThan {
- getLessThan :: a
Documentation
A join semilattice is an idempotent commutative semigroup.
(\/) :: s -> s -> s infixr 6 Source #
The join operation.
Laws:
Idempotence:
x \/
x = x
Associativity:
a\/
(b\/
c) = (a\/
b)\/
c
Commutativity:
a\/
b = b\/
a
Additionally, if s
has a Lower
bound, then lowerBound
must be its identity:
lowerBound
\/
a = a a\/
lowerBound
= a
If s
has an Upper
bound, then upperBound
must be its absorbing element:
upperBound
\/
a =upperBound
a\/
upperBound
=upperBound
Instances
Join Bool Source # | Boolean disjunction forms a semilattice. Idempotence: x \/ x == (x :: Bool) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: Bool) Commutativity: a \/ b == b \/ (a :: Bool) Identity: lowerBound \/ a == (a :: Bool) Absorption: upperBound \/ a == (upperBound :: Bool) |
Join Ordering Source # | Orderings form a semilattice. Idempotence: x \/ x == (x :: Ordering) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: Ordering) Commutativity: a \/ b == b \/ (a :: Ordering) Identity: lowerBound \/ a == (a :: Ordering) Absorption: upperBound \/ a == (upperBound :: Ordering) |
Join () Source # | |
Defined in Data.Semilattice.Join | |
Join IntSet Source # | IntSet union forms a semilattice. Idempotence: x \/ x == (x :: IntSet) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: IntSet) Commutativity: a \/ b == b \/ (a :: IntSet) Identity: lowerBound \/ a == (a :: IntSet) |
Ord a => Join (Max a) Source # | The least upperBound bound gives rise to a join semilattice. Idempotence: x \/ x == (x :: Max Int) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: Max Int) Commutativity: a \/ b == b \/ (a :: Max Int) Identity: lowerBound \/ a == (a :: Max Int) Absorption: upperBound \/ a == (upperBound :: Max Int) |
Join a => Join (IntMap a) Source # | IntMap union with Idempotence: x \/ x == (x :: IntMap (Set Char)) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: IntMap (Set Char)) Commutativity: a \/ b == b \/ (a :: IntMap (Set Char)) Identity: lowerBound \/ a == (a :: IntMap (Set Char)) |
Ord a => Join (Set a) Source # | Set union forms a semilattice. Idempotence: x \/ x == (x :: Set Char) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: Set Char) Commutativity: a \/ b == b \/ (a :: Set Char) Identity: lowerBound \/ a == (a :: Set Char) |
(Eq a, Hashable a) => Join (HashSet a) Source # | HashSet union forms a semilattice. Idempotence: x \/ x == (x :: HashSet Char) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: HashSet Char) Commutativity: a \/ b == b \/ (a :: HashSet Char) Identity: lowerBound \/ a == (a :: HashSet Char) |
Defined in Data.Semilattice.Join | |
Join a => Join (LessThan a) Source # | |
Join a => Join (Joining a) Source # | |
Meet a => Join (Tumble a) Source # | |
Ord a => Join (Order a) Source # | Total Idempotence: Order x \/ Order x == Order x Associativity: Order a \/ (Order b \/ Order c) == (Order a \/ Order b) \/ Order c Commutativity: Order a \/ Order b == Order b \/ Order a Identity: lowerBound \/ Order a == Order (a :: Int) Absorption: upperBound \/ Order a == (upperBound :: Order Int) Distributivity: Order a \/ Order b /\ Order c == (Order a \/ Order b) /\ (Order a \/ Order c) |
Join b => Join (a -> b) Source # | Functions with semilattice codomains form a semilattice. Idempotence: \ (Fn x) -> x \/ x ~= (x :: Int -> Bool) Associativity: \ (Fn a) (Fn b) (Fn c) -> a \/ (b \/ c) ~= (a \/ b) \/ (c :: Int -> Bool) Commutativity: \ (Fn a) (Fn b) -> a \/ b ~= b \/ (a :: Int -> Bool) Identity: \ (Fn a) -> lowerBound \/ a ~= (a :: Int -> Bool) Absorption: \ (Fn a) -> upperBound \/ a ~= (upperBound :: Int -> Bool) |
Defined in Data.Semilattice.Join | |
(Ord k, Join a) => Join (Map k a) Source # | Map union with Idempotence: x \/ x == (x :: Map Char (Set Char)) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: Map Char (Set Char)) Commutativity: a \/ b == b \/ (a :: Map Char (Set Char)) Identity: lowerBound \/ a == (a :: Map Char (Set Char)) |
(Eq k, Hashable k, Join a) => Join (HashMap k a) Source # | HashMap union with Idempotence: x \/ x == (x :: HashMap Char (Set Char)) Associativity: a \/ (b \/ c) == (a \/ b) \/ (c :: HashMap Char (Set Char)) Commutativity: a \/ b == b \/ (a :: HashMap Char (Set Char)) Identity: lowerBound \/ a == (a :: HashMap Char (Set Char)) |
Defined in Data.Semilattice.Join |
A Semigroup
for any Join
semilattice.
If the semilattice has a Lower
bound, there is additionally a Monoid
instance.
Joining | |
|
Instances
Functor Joining Source # | |
Foldable Joining Source # | |
Defined in Data.Semilattice.Join fold :: Monoid m => Joining m -> m # foldMap :: Monoid m => (a -> m) -> Joining a -> m # foldr :: (a -> b -> b) -> b -> Joining a -> b # foldr' :: (a -> b -> b) -> b -> Joining a -> b # foldl :: (b -> a -> b) -> b -> Joining a -> b # foldl' :: (b -> a -> b) -> b -> Joining a -> b # foldr1 :: (a -> a -> a) -> Joining a -> a # foldl1 :: (a -> a -> a) -> Joining a -> a # elem :: Eq a => a -> Joining a -> Bool # maximum :: Ord a => Joining a -> a # minimum :: Ord a => Joining a -> a # | |
Traversable Joining Source # | |
Bounded a => Bounded (Joining a) Source # | |
Enum a => Enum (Joining a) Source # | |
Defined in Data.Semilattice.Join succ :: Joining a -> Joining a # pred :: Joining a -> Joining a # fromEnum :: Joining a -> Int # enumFrom :: Joining a -> [Joining a] # enumFromThen :: Joining a -> Joining a -> [Joining a] # enumFromTo :: Joining a -> Joining a -> [Joining a] # enumFromThenTo :: Joining a -> Joining a -> Joining a -> [Joining a] # | |
Eq a => Eq (Joining a) Source # | |
Num a => Num (Joining a) Source # | |
Defined in Data.Semilattice.Join | |
Ord a => Ord (Joining a) Source # | |
Defined in Data.Semilattice.Join | |
Read a => Read (Joining a) Source # | |
Show a => Show (Joining a) Source # | |
Join a => Semigroup (Joining a) Source # | \ a b c -> Joining a <> (Joining b <> Joining c) == (Joining a <> Joining b) <> Joining (c :: IntSet) |
(Lower a, Join a) => Monoid (Joining a) Source # |
\ x -> let (l, r) = (mappend mempty (Joining x), mappend (Joining x) mempty) in l == Joining x && r == Joining (x :: IntSet) |
Lower a => Lower (Joining a) Source # | |
Defined in Data.Semilattice.Join lowerBound :: Joining a Source # | |
Join a => Join (Joining a) Source # | |
LessThan | |
|