planet-mitchell-0.1.0: Planet Mitchell

Semilattice

Synopsis

# Documentation

class Join s where #

A join semilattice is an idempotent commutative semigroup.

Minimal complete definition

(\/)

Methods

(\/) :: s -> s -> s infixr 6 #

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
 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: Bool -> Bool -> Bool # 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) Instance detailsDefined in Data.Semilattice.Join Methods Join () Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: () -> () -> () # 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: IntSet -> IntSet -> IntSet # Ord a => Join (Max a) 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: Max a -> Max a -> Max a # Join a => Join (IntMap a) IntMap union with Joinable values forms a semilattice.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)) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: IntMap a -> IntMap a -> IntMap a # Ord a => Join (Set a) 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: Set a -> Set a -> Set a # (Eq a, Hashable a) => Join (HashSet a) 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: HashSet a -> HashSet a -> HashSet a # Ord a => Join (Order a) Total Orderings give rise to a join semilattice satisfying:Idempotence:Order x \/ Order x == Order xAssociativity:Order a \/ (Order b \/ Order c) == (Order a \/ Order b) \/ Order cCommutativity:Order a \/ Order b == Order b \/ Order aIdentity: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) Instance detailsDefined in Data.Semilattice.Order Methods(\/) :: Order a -> Order a -> Order a # Join a => Join (Joining a) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: Joining a -> Joining a -> Joining a # Join a => Join (LessThan a) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: LessThan a -> LessThan a -> LessThan a # Join b => Join (a -> b) 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) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: (a -> b) -> (a -> b) -> a -> b # (Eq k, Hashable k, Join a) => Join (HashMap k a) HashMap union with Joinable values forms a semilattice.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)) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: HashMap k a -> HashMap k a -> HashMap k a # (Ord k, Join a) => Join (Map k a) Map union with Joinable values forms a semilattice.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)) Instance detailsDefined in Data.Semilattice.Join Methods(\/) :: Map k a -> Map k a -> Map k a #

class Meet s where #

A meet semilattice is an idempotent commutative semigroup.

Minimal complete definition

(/\)

Methods

(/\) :: s -> s -> s infixr 7 #

The meet operation.

Laws:

Idempotence:

x /\ x = x


Associativity:

a /\ (b /\ c) = (a /\ b) /\ c


Commutativity:

a /\ b = b /\ a


Additionally, if s has an Upper bound, then upperBound must be its identity:

upperBound /\ a = a
a /\ upperBound = a


If s has a Lower bound, then lowerBound must be its absorbing element:

lowerBound /\ a = lowerBound
a /\ lowerBound = lowerBound

Instances
 Boolean conjunction forms a semilattice.Idempotence:x /\ x == (x :: Bool)Associativity:a /\ (b /\ c) == (a /\ b) /\ (c :: Bool)Commutativity:a /\ b == b /\ (a :: Bool)Identity:upperBound /\ a == (a :: Bool)Absorption:lowerBound /\ a == (lowerBound :: Bool) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: Bool -> Bool -> Bool # Orderings form a semilattice.Idempotence:x /\ x == (x :: Ordering)Associativity:a /\ (b /\ c) == (a /\ b) /\ (c :: Ordering)Commutativity:a /\ b == b /\ (a :: Ordering)Identity:upperBound /\ a == (a :: Ordering)Absorption:lowerBound /\ a == (lowerBound :: Ordering) Instance detailsDefined in Data.Semilattice.Meet Methods Meet () Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: () -> () -> () # IntSet intersection forms a semilattice.Idempotence:x /\ x == (x :: IntSet)Associativity:a /\ (b /\ c) == (a /\ b) /\ (c :: IntSet)Commutativity:a /\ b == b /\ (a :: IntSet)Absorption:lowerBound /\ a == (lowerBound :: IntSet) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: IntSet -> IntSet -> IntSet # Ord a => Meet (Min a) The greatest lowerBound bound gives rise to a meet semilattice.Idempotence:x /\ x == (x :: Min Int)Associativity:a /\ (b /\ c) == (a /\ b) /\ (c :: Min Int)Commutativity:a /\ b == b /\ (a :: Min Int)Identity:upperBound /\ a == (a :: Min Int)Absorption:lowerBound /\ a == (lowerBound :: Min Int) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: Min a -> Min a -> Min a # Meet a => Meet (IntMap a) IntMap union with Meetable values forms a semilattice.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))Absorption:lowerBound /\ a == (lowerBound :: IntMap (Set Char)) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: IntMap a -> IntMap a -> IntMap a # Ord a => Meet (Set a) Set intersection 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)Absorption:lowerBound /\ a == (lowerBound :: Set Char) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: Set a -> Set a -> Set a # (Eq a, Hashable a) => Meet (HashSet a) HashSet intersection 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)Absorption:lowerBound /\ a == (lowerBound :: HashSet Char) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: HashSet a -> HashSet a -> HashSet a # Ord a => Meet (Order a) Total Orderings give rise to a meet semilattice satisfying:Idempotence:Order x /\ Order x == Order xAssociativity:Order a /\ (Order b /\ Order c) == (Order a /\ Order b) /\ Order cCommutativity:Order a /\ Order b == Order b /\ Order aIdentity:upperBound /\ Order a == Order (a :: Int)Absorption:lowerBound /\ Order a == (lowerBound :: Order Int)Distributivity:Order a /\ (Order b \/ Order c) == Order a /\ Order b \/ Order a /\ Order c Instance detailsDefined in Data.Semilattice.Order Methods(/\) :: Order a -> Order a -> Order a # Meet a => Meet (Meeting a) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: Meeting a -> Meeting a -> Meeting a # Meet a => Meet (GreaterThan a) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: GreaterThan a -> GreaterThan a -> GreaterThan a # Meet b => Meet (a -> b) 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) -> upperBound /\ a ~= (a :: Int -> Bool)Absorption:\ (Fn a) -> lowerBound /\ a ~= (lowerBound :: Int -> Bool) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: (a -> b) -> (a -> b) -> a -> b # (Eq k, Hashable k, Meet a) => Meet (HashMap k a) HashMap union with Meetable values forms a semilattice.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))Absorption:lowerBound /\ a == (lowerBound :: HashMap Char (Set Char)) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: HashMap k a -> HashMap k a -> HashMap k a # (Ord k, Meet a) => Meet (Map k a) Map union with Meetable values forms a semilattice.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))Absorption:lowerBound /\ a == (lowerBound :: Map Char (Set Char)) Instance detailsDefined in Data.Semilattice.Meet Methods(/\) :: Map k a -> Map k a -> Map k a #

newtype Order a #

A Join- and Meet-semilattice for any total Ordering.

Constructors

 Order FieldsgetOrder :: a
Instances
 Instance detailsDefined in Data.Semilattice.Order Methodsfmap :: (a -> b) -> Order a -> Order b #(<\$) :: a -> Order b -> Order a # Instance detailsDefined in Data.Semilattice.Order Methodsfold :: Monoid m => Order m -> m #foldMap :: Monoid m => (a -> m) -> Order a -> m #foldr :: (a -> b -> b) -> b -> Order a -> b #foldr' :: (a -> b -> b) -> b -> Order a -> b #foldl :: (b -> a -> b) -> b -> Order a -> b #foldl' :: (b -> a -> b) -> b -> Order a -> b #foldr1 :: (a -> a -> a) -> Order a -> a #foldl1 :: (a -> a -> a) -> Order a -> a #toList :: Order a -> [a] #null :: Order a -> Bool #length :: Order a -> Int #elem :: Eq a => a -> Order a -> Bool #maximum :: Ord a => Order a -> a #minimum :: Ord a => Order a -> a #sum :: Num a => Order a -> a #product :: Num a => Order a -> a # Instance detailsDefined in Data.Semilattice.Order Methodstraverse :: Applicative f => (a -> f b) -> Order a -> f (Order b) #sequenceA :: Applicative f => Order (f a) -> f (Order a) #mapM :: Monad m => (a -> m b) -> Order a -> m (Order b) #sequence :: Monad m => Order (m a) -> m (Order a) # Bounded a => Bounded (Order a) Instance detailsDefined in Data.Semilattice.Order Methods Enum a => Enum (Order a) Instance detailsDefined in Data.Semilattice.Order Methodssucc :: Order a -> Order a #pred :: Order a -> Order a #toEnum :: Int -> Order a #fromEnum :: Order a -> Int #enumFrom :: Order a -> [Order a] #enumFromThen :: Order a -> Order a -> [Order a] #enumFromTo :: Order a -> Order a -> [Order a] #enumFromThenTo :: Order a -> Order a -> Order a -> [Order a] # Eq a => Eq (Order a) Instance detailsDefined in Data.Semilattice.Order Methods(==) :: Order a -> Order a -> Bool #(/=) :: Order a -> Order a -> Bool # Num a => Num (Order a) Instance detailsDefined in Data.Semilattice.Order Methods(+) :: Order a -> Order a -> Order a #(-) :: Order a -> Order a -> Order a #(*) :: Order a -> Order a -> Order a #negate :: Order a -> Order a #abs :: Order a -> Order a #signum :: Order a -> Order a # Ord a => Ord (Order a) Instance detailsDefined in Data.Semilattice.Order Methodscompare :: Order a -> Order a -> Ordering #(<) :: Order a -> Order a -> Bool #(<=) :: Order a -> Order a -> Bool #(>) :: Order a -> Order a -> Bool #(>=) :: Order a -> Order a -> Bool #max :: Order a -> Order a -> Order a #min :: Order a -> Order a -> Order a # Read a => Read (Order a) Instance detailsDefined in Data.Semilattice.Order MethodsreadsPrec :: Int -> ReadS (Order a) #readList :: ReadS [Order a] # Show a => Show (Order a) Instance detailsDefined in Data.Semilattice.Order MethodsshowsPrec :: Int -> Order a -> ShowS #show :: Order a -> String #showList :: [Order a] -> ShowS # Ord a => Meet (Order a) Total Orderings give rise to a meet semilattice satisfying:Idempotence:Order x /\ Order x == Order xAssociativity:Order a /\ (Order b /\ Order c) == (Order a /\ Order b) /\ Order cCommutativity:Order a /\ Order b == Order b /\ Order aIdentity:upperBound /\ Order a == Order (a :: Int)Absorption:lowerBound /\ Order a == (lowerBound :: Order Int)Distributivity:Order a /\ (Order b \/ Order c) == Order a /\ Order b \/ Order a /\ Order c Instance detailsDefined in Data.Semilattice.Order Methods(/\) :: Order a -> Order a -> Order a # Upper a => Upper (Order a) Instance detailsDefined in Data.Semilattice.Order Methods Ord a => Join (Order a) Total Orderings give rise to a join semilattice satisfying:Idempotence:Order x \/ Order x == Order xAssociativity:Order a \/ (Order b \/ Order c) == (Order a \/ Order b) \/ Order cCommutativity:Order a \/ Order b == Order b \/ Order aIdentity: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) Instance detailsDefined in Data.Semilattice.Order Methods(\/) :: Order a -> Order a -> Order a # Lower a => Lower (Order a) Instance detailsDefined in Data.Semilattice.Order Methods