@@ -119,16 +119,16 @@ instance categoryArr :: Category Prim.Function
119119($) :: forall a b. (a -> b) -> a -> b
120120```
121121
122−Applies a function to its argument
122+Applies a function to its argument.
123123
124124```purescript
125−length $ groupBy productCategory $ filter isInStock products
125+length $ groupBy productCategory $ filter isInStock $ products
126126```
127127
128128is equivalent to
129129
130130```purescript
131−length (groupBy productCategory (filter isInStock (products)))
131+length (groupBy productCategory (filter isInStock products))
132132```
133133
134134`($)` is different from [`(#)`](#-2) because it is right-infix instead of left, so
@@ -141,16 +141,16 @@ length (groupBy productCategory (filter isInStock (products)))
141141(#) :: forall a b. a -> (a -> b) -> b
142142```
143143
144−Applies a function to its argument
144+Applies an argument to a function.
145145
146146```purescript
147−products # groupBy productCategory # filter isInStock # length
147+products # filter isInStock # groupBy productCategory # length
148148```
149149
150150is equivalent to
151151
152152```purescript
153−length (groupBy productCategory (filter isInStock (products)))
153+length (groupBy productCategory (filter isInStock products))
154154```
155155
156156`(#)` is different from [`($)`](#-1) because it is left-infix instead of right, so
@@ -190,7 +190,7 @@ class Show a where
190190
191191The `Show` type class represents those types which can be converted into a human-readable `String` representation.
192192
193−While not required, it is recommended that for any expression `x`, the string `show x` be executable PureScript code
193+While not required, it is recommended that for any expression `x`, the string `show x` be executable PureScript code
194194which evaluates to the same value as the expression `x`.
195195
196196#### `showUnit`
@@ -264,7 +264,7 @@ types use the type constructor `f` to represent some computational context.
264264void :: forall f a. (Functor f) => f a -> f Unit
265265```
266266
267−The `void` function is used to ignore the type wrapped by a [`Functor`](#functor), replacing it with `Unit` and
267+The `void` function is used to ignore the type wrapped by a [`Functor`](#functor), replacing it with `Unit` and
268268keeping only the type information provided by the type constructor itself.
269269
270270`void` is often useful when using `do` notation to change the return type of a monadic computation:
@@ -311,8 +311,8 @@ class (Apply f) <= Applicative f where
311311The `Applicative` type class extends the [`Apply`](#apply) type class with a `pure` function, which can be used to
312312create values of type `f a` from values of type `a`.
313313
314−Where [`Apply`](#apply) provides the ability to lift functions of two or more arguments to functions whose arguments are wrapped using `f`,
315−and [`Functor`](#functor) provides the ability to lift functions of one argument, `pure` can be seen as the function which lifts functions of
314+Where [`Apply`](#apply) provides the ability to lift functions of two or more arguments to functions whose arguments are wrapped using `f`,
315+and [`Functor`](#functor) provides the ability to lift functions of one argument, `pure` can be seen as the function which lifts functions of
316316_zero_ arguments. That is, `Applicative` functors support a lifting operation for any number of function arguments.
317317
318318`Applicative` instances should satisfy the following laws:
@@ -362,7 +362,7 @@ where the function argument of `f` is given the name `y`.
362362
363363- Associativity: `(x >>= f) >>= g = x >>= (\k => f k >>= g)`
364364
365−Or, expressed using `do` notation:
365+Or, expressed using `do` notation:
366366
367367- Associativity: `do { z <- do { y <- x ; f y } ; g z } = do { k <- x ; do { y <- f k ; g y } }`
368368
@@ -388,7 +388,7 @@ represent type constructors which support sequential composition, and also lifti
388388- Left Identity: `pure x >>= f = f x`
389389- Right Identity: `x >>= pure = x`
390390
391−Or, expressed using `do` notation:
391+Or, expressed using `do` notation:
392392
393393- Left Identity: `do { y <- pure x ; f y } = f x`
394394- Right Identity: `do { y <- x ; pure y } = x`
@@ -612,21 +612,7 @@ The `Eq` type class represents types which support decidable equality.
612612- Transitivity: if `x == y` and `y == z` then `x == z`
613613- Negation: `x /= y = not (x == y)`
614614
615−`(/=)` may be implemented in terms of `(==)`, but it might give a performance improvement to implement it separately.
616−
617−#### `refEq`
618−
619−``` purescript
620−refEq :: forall a. a -> a -> Boolean
621−```
622−
623−
624−#### `refIneq`
625−
626−``` purescript
627−refIneq :: forall a. a -> a -> Boolean
628−```
629−
615+`(/=)` may be implemented in terms of `(==)`, but it might give a performance improvement to implement it separately.
630616
631617#### `eqUnit`
632618
@@ -782,49 +768,170 @@ instance ordArray :: (Ord a) => Ord [a]
782768```
783769
784770
785−#### `Bits`
771+#### `Bounded`
786772
787773``` purescript
788−class Bits b where
789− (.&.) :: b -> b -> b
790− (.|.) :: b -> b -> b
791− (.^.) :: b -> b -> b
792− shl :: b -> Number -> b
793− shr :: b -> Number -> b
794− zshr :: b -> Number -> b
795− complement :: b -> b
774+class (Ord a) <= Bounded a where
775+ top :: a
776+ bottom :: a
796777```
797778
798−The `Bits` type class identifies types which support bitwise operations.
779+The `Bounded` type class represents types that are finite partially
780+ordered sets.
799781
800−#### `bitsNumber`
782+Instances should satisfy the following law in addition to the `Ord` laws:
783+
784+- Ordering: `bottom <= a <= top`
785+
786+#### `boundedBoolean`
801787
802788``` purescript
803−instance bitsNumber :: Bits Number
789+instance boundedBoolean :: Bounded Boolean
790+```
791+
792+
793+#### `Lattice`
794+
795+``` purescript
796+class (Ord a) <= Lattice a where
797+ sup :: a -> a -> a
798+ inf :: a -> a -> a
799+```
800+
801+The `Lattice` type class represents types that are partially ordered
802+sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
803+
804+Instances should satisfy the following laws in addition to the `Ord`
805+laws:
806+
807+- Associativity:
808+ - `a || (b || c) = (a || b) || c`
809+ - `a && (b && c) = (a && b) && c`
810+- Commutativity:
811+ - `a || b = b || a`
812+ - `a && b = b && a`
813+- Absorption:
814+ - `a || (a && b) = a`
815+ - `a && (a || b) = a`
816+- Idempotent:
817+ - `a || a = a`
818+ - `a && a = a`
819+
820+#### `latticeBoolean`
821+
822+``` purescript
823+instance latticeBoolean :: Lattice Boolean
824+```
825+
826+
827+#### `BoundedLattice`
828+
829+``` purescript
830+class (Bounded a, Lattice a) <= BoundedLattice a where
804831```
805832
833+The `BoundedLattice` type class represents types that are finite
834+lattices.
835+
836+Instances should satisfy the following law in addition to the `Lattice`
837+and `Bounded` laws:
838+
839+- Identity:
840+ - `a || bottom = a`
841+ - `a && top = a`
842+- Annihiliation:
843+ - `a || top = top`
844+ - `a && bottom = bottom`
806845
807−#### `BoolLike`
846+#### `boundedLatticeBoolean`
808847
809848``` purescript
810−class BoolLike b where
811− (&&) :: b -> b -> b
812− (||) :: b -> b -> b
813− not :: b -> b
849+instance boundedLatticeBoolean :: BoundedLattice Boolean
814850```
815851
816−The `BoolLike` type class identifies types which support Boolean operations.
817852
818−`BoolLike` instances are required to satisfy the laws of a _Boolean algebra_.
853+#### `ComplementedLattice`
854+
855+``` purescript
856+class (BoundedLattice a) <= ComplementedLattice a where
857+ not :: a -> a
858+```
819859
860+The `ComplementedLattice` type class represents types that are lattices
861+where every member is also uniquely complemented.
820862
821−#### `boolLikeBoolean`
863+Instances should satisfy the following law in addition to the
864+`BoundedLattice` laws:
865+
866+- Complemented:
867+ - `not a || a == top`
868+ - `not a && a == bottom`
869+- Double negation:
870+ - `not <<< not == id`
871+
872+#### `complementedLatticeBoolean`
822873
823874``` purescript
824−instance boolLikeBoolean :: BoolLike Boolean
875+instance complementedLatticeBoolean :: ComplementedLattice Boolean
825876```
826877
827878
879+#### `DistributiveLattice`
880+
881+``` purescript
882+class (Lattice a) <= DistributiveLattice a where
883+```
884+
885+The `DistributiveLattice` type class represents types that are lattices
886+where the `&&` and `||` distribute over each other.
887+
888+Instances should satisfy the following law in addition to the `Lattice`
889+laws:
890+
891+- Distributivity: `x && (y || z) = (x && y) || (x && z)`
892+
893+#### `distributiveLatticeBoolean`
894+
895+``` purescript
896+instance distributiveLatticeBoolean :: DistributiveLattice Boolean
897+```
898+
899+
900+#### `BooleanAlgebra`
901+
902+``` purescript
903+class (ComplementedLattice a, DistributiveLattice a) <= BooleanAlgebra a where
904+```
905+
906+The `BooleanAlgebra` type class represents types that are Boolean
907+algebras, also known as Boolean lattices.
908+
909+Instances should satisfy the `ComplementedLattice` and
910+`DistributiveLattice` laws.
911+
912+#### `booleanAlgebraBoolean`
913+
914+``` purescript
915+instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
916+```
917+
918+
919+#### `(||)`
920+
921+``` purescript
922+(||) :: forall a. (Lattice a) => a -> a -> a
923+```
924+
925+The `sup` operator.
926+
927+#### `(&&)`
928+
929+``` purescript
930+(&&) :: forall a. (Lattice a) => a -> a -> a
931+```
932+
933+The `inf` operator.
934+
828935#### `Semigroup`
829936
830937``` purescript
@@ -838,7 +945,7 @@ The `Semigroup` type class identifies an associative operation on a type.
838945
839946- Associativity: `(x <> y) <> z = x <> (y <> z)`
840947
841−For example, the `String` type is an instance of `Semigroup`, where `(<>)` is defined to be string concatenation.
948+For example, the `String` type is an instance of `Semigroup`, where `(<>)` is defined to be string concatenation.
842949
843950#### `semigroupUnit`
844951
@@ -869,6 +976,28 @@ instance semigroupArr :: (Semigroup s') => Semigroup (s -> s')
869976
870977`(++)` is an alias for `(<>)`.
871978
979+#### `Bits`
980+
981+``` purescript
982+class Bits b where
983+ (.&.) :: b -> b -> b
984+ (.|.) :: b -> b -> b
985+ (.^.) :: b -> b -> b
986+ shl :: b -> Number -> b
987+ shr :: b -> Number -> b
988+ zshr :: b -> Number -> b
989+ complement :: b -> b
990+```
991+
992+The `Bits` type class identifies types which support bitwise operations.
993+
994+#### `bitsNumber`
995+
996+``` purescript
997+instance bitsNumber :: Bits Number
998+```
999+
1000+
8721001
8731002## Module Data.Function
8741003
@@ -1243,7 +1372,7 @@ untilE :: forall e. Eff e Boolean -> Eff e Unit
12431372
12441373Loop until a condition becomes `true`.
12451374
1246−`untilE b` is an effectful computation which repeatedly runs the effectful computation `b`,
1375+`untilE b` is an effectful computation which repeatedly runs the effectful computation `b`,
12471376until its return value is `true`.
12481377
12491378#### `whileE`
@@ -1254,7 +1383,7 @@ whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
12541383
12551384Loop while a condition is `true`.
12561385
1257−`whileE b m` is effectful computation which runs the effectful computation `b`. If its result is
1386+`whileE b m` is effectful computation which runs the effectful computation `b`. If its result is
12581387`true`, it runs the effectful computation `m` and loops. If not, the computation ends.
12591388
12601389#### `forE`