semilattices-0.0.0.0: Semilattices

Safe HaskellNone
LanguageHaskell2010

Data.Semilattice.Order

Description

Total Orderings give rise to Join and Meet semilattices.

Synopsis

Documentation

newtype Order a Source #

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

Constructors

Order 

Fields

Instances

Functor Order Source # 

Methods

fmap :: (a -> b) -> Order a -> Order b #

(<$) :: a -> Order b -> Order a #

Foldable Order Source # 

Methods

fold :: 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 #

Traversable Order Source # 

Methods

traverse :: 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) Source # 

Methods

minBound :: Order a #

maxBound :: Order a #

Enum a => Enum (Order a) Source # 

Methods

succ :: 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) Source # 

Methods

(==) :: Order a -> Order a -> Bool #

(/=) :: Order a -> Order a -> Bool #

Num a => Num (Order a) Source # 

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 #

fromInteger :: Integer -> Order a #

Ord a => Ord (Order a) Source # 

Methods

compare :: 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) Source # 
Show a => Show (Order a) Source # 

Methods

showsPrec :: Int -> Order a -> ShowS #

show :: Order a -> String #

showList :: [Order a] -> ShowS #

Lower a => Lower (Order a) Source # 

Methods

lowerBound :: Order a Source #

Ord a => Join (Order a) Source #

Total Orderings give rise to a join semilattice satisfying:

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)

Methods

(\/) :: Order a -> Order a -> Order a Source #

Upper a => Upper (Order a) Source # 

Methods

upperBound :: Order a Source #

Ord a => Meet (Order a) Source #

Total Orderings give rise to a meet semilattice satisfying:

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:

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

Methods

(/\) :: Order a -> Order a -> Order a Source #

>>> import Test.QuickCheck