Module

# Data.Lattice

Package
purescript-colehaus-lattice
Repository
colehaus/purescript-lattice

### #JoinSemilatticeSource

``class JoinSemilattice a  where``

A `JoinSemilattice` must satisfy the following laws:

• Associativity of join: forall a b c, join a (join b c) == join (join a b) c
• Commutativity of join: forall a b, join a b == join b a
• Idempotency of join: forall a, join a a == a

Join semilattices capture the notion of sets with a "least upper bound".

#### Members

• `join :: a -> a -> a`

#### Instances

• `JoinSemilattice Boolean`

### #MeetSemilatticeSource

``class MeetSemilattice a  where``

A `MeetSemilattice` must satisfy the following laws:

• Associativity of meet: forall a b c, meet a (meet b c) == meet (meet a b) c
• Commutativity of meet: forall a b, meet a b == meet b a
• Idempotency of meet: forall a, meet a a == a

Meet semilattices capture the notion of sets with a "greatest lower bound".

#### Members

• `meet :: a -> a -> a`

#### Instances

• `MeetSemilattice Boolean`

### #BoundedJoinSemilatticeSource

``class (JoinSemilattice a) <= BoundedJoinSemilattice a  where``

A `BoundedJoinSemilattice` must satisfy the following laws in addition to `JoinSemilattice` laws:

• Bottom (Unitary Element): forall a, join a bottom == a

Join semilattices capture the notion of sets with a "least upper bound" equipped with a "bottom" element.

#### Members

• `bottom :: a`

#### Instances

• `BoundedJoinSemilattice Boolean`

### #BoundedMeetSemilatticeSource

``class (MeetSemilattice a) <= BoundedMeetSemilattice a  where``

A `BoundedMeetSemilattice` must satisfy the following laws in addition to `MeetSemilattice` laws:

• Top (Unitary Element): forall a, meet a top == a

Meet semilattices capture the notion of sets with a "greatest lower bound" equipped with a "top" element.

#### Members

• `top :: a`

#### Instances

• `BoundedMeetSemilattice Boolean`

### #LatticeSource

``class (JoinSemilattice a, MeetSemilattice a) <= Lattice a ``

A `Lattice` must satisfy the following in addition to `JoinSemilattice` and `MeetSemilattice` laws:

• Absorbtion laws for meet and join: forall a b, meet a (join a b) == a forall a b, join a (meet a b) == a

#### Instances

• `Lattice Boolean`

### #BoundedLatticeSource

``class (BoundedJoinSemilattice a, BoundedMeetSemilattice a) <= BoundedLattice a ``

A `BoundedLattice` must satisfy the following in addition to `BoundedMeetSemilattice` and `BoundedJoinSemilattice` laws:

• Absorbtion laws for meet and join: forall a b, meet a (join a b) == a forall a b, join a (meet a b) == a

#### Instances

• `BoundedLattice Boolean`

### #MeetSource

``newtype Meet a``

Monoid wrapper for `MeetSemilattice`

#### Constructors

• `MkMeet a`

#### Instances

• `Newtype (Meet a) _`
• `Generic (Meet a) _`
• `(Eq a) => Eq (Meet a)`
• `(Ord a) => Ord (Meet a)`
• `(Bounded a) => Bounded (Meet a)`
• `(Show a) => Show (Meet a)`
• `(MeetSemilattice a) => Semigroup (Meet a)`
• `(BoundedMeetSemilattice a) => Monoid (Meet a)`

### #JoinSource

``newtype Join a``

Monoid wrapper for `JoinSemilattice`

#### Constructors

• `MkJoin a`

#### Instances

• `Newtype (Join a) _`
• `Generic (Join a) _`
• `(Eq a) => Eq (Join a)`
• `(Ord a) => Ord (Join a)`
• `(Bounded a) => Bounded (Join a)`
• `(Show a) => Show (Join a)`
• `(JoinSemilattice a) => Semigroup (Join a)`
• `(BoundedJoinSemilattice a) => Monoid (Join a)`