| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Semilattice.Join
Description
Join semilattices, related to Lower and Upper.
- 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.
Minimal complete definition
Methods
(\/) :: 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 =upperBounda\/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 # | |
| 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) |
| 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) |
| (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)) |
A Semigroup for any Join semilattice.
If the semilattice has a Lower bound, there is additionally a Monoid instance.
Constructors
| Joining | |
Fields
| |
Instances
| Functor Joining Source # | |
| Foldable Joining Source # | |
| Traversable Joining Source # | |
| Bounded a => Bounded (Joining a) Source # | |
| Enum a => Enum (Joining a) Source # | |
| Eq a => Eq (Joining a) Source # | |
| Num a => Num (Joining a) Source # | |
| Ord a => Ord (Joining a) Source # | |
| 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 # | |
| Join a => Join (Joining a) Source # | |
Constructors
| LessThan | |
Fields
| |
Instances
| Functor LessThan Source # | |
| Foldable LessThan Source # | |
| Traversable LessThan Source # | |
| Enum a => Enum (LessThan a) Source # | |
| Eq a => Eq (LessThan a) Source # | |
| Num a => Num (LessThan a) Source # | |
| (Eq a, Join a) => Ord (LessThan a) Source # | |
| Read a => Read (LessThan a) Source # | |
| Show a => Show (LessThan a) Source # | |
| Join a => Join (LessThan a) Source # | |