@@ -25,6 +25,9 @@ implementation JoinSemilattice Nat where
25implementation Ord a => JoinSemilattice (MaxiphobicHeap a) where
25implementation Ord a => JoinSemilattice (MaxiphobicHeap a) where
26 join = merge
26 join = merge
28+JoinSemilattice Bool where
28||| Sets equipped with a binary operation that is commutative, associative and
31||| Sets equipped with a binary operation that is commutative, associative and
29||| idempotent. Must satisfy the following laws:
32||| idempotent. Must satisfy the following laws:
@@ -42,6 +45,9 @@ interface MeetSemilattice a where
42implementation MeetSemilattice Nat where
45implementation MeetSemilattice Nat where
43 meet = minimum
46 meet = minimum
48+MeetSemilattice Bool where
45||| Sets equipped with a binary operation that is commutative, associative and
51||| Sets equipped with a binary operation that is commutative, associative and
46||| idempotent and supplied with a unitary element. Must satisfy the following
52||| idempotent and supplied with a unitary element. Must satisfy the following
@@ -63,6 +69,9 @@ interface JoinSemilattice a => BoundedJoinSemilattice a where
63implementation BoundedJoinSemilattice Nat where
69implementation BoundedJoinSemilattice Nat where
64 bottom = Z
70 bottom = Z
72+BoundedJoinSemilattice Bool where
66||| Sets equipped with a binary operation that is commutative, associative and
75||| Sets equipped with a binary operation that is commutative, associative and
67||| idempotent and supplied with a unitary element. Must satisfy the following
76||| idempotent and supplied with a unitary element. Must satisfy the following
@@ -81,6 +90,9 @@ implementation BoundedJoinSemilattice Nat where
81interface MeetSemilattice a => BoundedMeetSemilattice a where
90interface MeetSemilattice a => BoundedMeetSemilattice a where
93+BoundedMeetSemilattice Bool where
84||| Sets equipped with two binary operations that are both commutative,
96||| Sets equipped with two binary operations that are both commutative,
85||| associative and idempotent, along with absorbtion laws for relating the two
97||| associative and idempotent, along with absorbtion laws for relating the two
86||| binary operations. Must satisfy the following:
98||| binary operations. Must satisfy the following:
@@ -101,6 +113,8 @@ interface (JoinSemilattice a, MeetSemilattice a) => Lattice a where { }
102implementation Lattice Nat where { }
114implementation Lattice Nat where { }
116+Lattice Bool where { }
104||| Sets equipped with two binary operations that are both commutative,
118||| Sets equipped with two binary operations that are both commutative,
105||| associative and idempotent and supplied with neutral elements, along with
119||| associative and idempotent and supplied with neutral elements, along with
106||| absorbtion laws for relating the two binary operations. Must satisfy the
120||| absorbtion laws for relating the two binary operations. Must satisfy the
@@ -122,3 +136,5 @@ implementation Lattice Nat where { }
122||| forall a, meet a top == top
136||| forall a, meet a top == top
123||| forall a, join a bottom == bottom
137||| forall a, join a bottom == bottom
124interface (BoundedJoinSemilattice a, BoundedMeetSemilattice a) => BoundedLattice a where { }
138interface (BoundedJoinSemilattice a, BoundedMeetSemilattice a) => BoundedLattice a where { }
140+BoundedLattice Bool where { }