@@ -119,16 +119,16 @@ instance categoryArr :: Category Prim.Function
119($) :: forall a b. (a -> b) -> a -> b
119($) :: forall a b. (a -> b) -> a -> b
122−Applies a function to its argument
122+Applies a function to its argument.
124```purescript
124```purescript
125−length $ groupBy productCategory $ filter isInStock products
125+length $ groupBy productCategory $ filter isInStock $ products
128is equivalent to
128is equivalent to
130```purescript
130```purescript
131−length (groupBy productCategory (filter isInStock (products)))
131+length (groupBy productCategory (filter isInStock products))
134`($)` is different from [`(#)`](#-2) because it is right-infix instead of left, so
134`($)` is different from [`(#)`](#-2) because it is right-infix instead of left, so
@@ -141,16 +141,16 @@ length (groupBy productCategory (filter isInStock (products)))
141(#) :: forall a b. a -> (a -> b) -> b
141(#) :: forall a b. a -> (a -> b) -> b
144−Applies a function to its argument
144+Applies an argument to a function.
146```purescript
146```purescript
147−products # groupBy productCategory # filter isInStock # length
147+products # filter isInStock # groupBy productCategory # length
150is equivalent to
150is equivalent to
152```purescript
152```purescript
153−length (groupBy productCategory (filter isInStock (products)))
153+length (groupBy productCategory (filter isInStock products))
156`(#)` is different from [`($)`](#-1) because it is left-infix instead of right, so
156`(#)` is different from [`($)`](#-1) because it is left-infix instead of right, so
@@ -190,7 +190,7 @@ class Show a where
191The `Show` type class represents those types which can be converted into a human-readable `String` representation.
191The `Show` type class represents those types which can be converted into a human-readable `String` representation.
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
194which evaluates to the same value as the expression `x`.
194which evaluates to the same value as the expression `x`.
196#### `showUnit`
196#### `showUnit`
@@ -264,7 +264,7 @@ types use the type constructor `f` to represent some computational context.
264void :: forall f a. (Functor f) => f a -> f Unit
264void :: forall f a. (Functor f) => f a -> f Unit
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
268keeping only the type information provided by the type constructor itself.
268keeping only the type information provided by the type constructor itself.
270`void` is often useful when using `do` notation to change the return type of a monadic computation:
270`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
311The `Applicative` type class extends the [`Apply`](#apply) type class with a `pure` function, which can be used to
311The `Applicative` type class extends the [`Apply`](#apply) type class with a `pure` function, which can be used to
312create values of type `f a` from values of type `a`.
312create values of type `f a` from values of type `a`.
314−Where [`Apply`](#apply) provides the ability to lift functions of two or more arguments to functions whose arguments are wrapped using `f`,
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
315+and [`Functor`](#functor) provides the ability to lift functions of one argument, `pure` can be seen as the function which lifts functions of
316_zero_ arguments. That is, `Applicative` functors support a lifting operation for any number of function arguments.
316_zero_ arguments. That is, `Applicative` functors support a lifting operation for any number of function arguments.
318`Applicative` instances should satisfy the following laws:
318`Applicative` instances should satisfy the following laws:
@@ -362,7 +362,7 @@ where the function argument of `f` is given the name `y`.
363- Associativity: `(x >>= f) >>= g = x >>= (\k => f k >>= g)`
363- Associativity: `(x >>= f) >>= g = x >>= (\k => f k >>= g)`
365−Or, expressed using `do` notation:
365+Or, expressed using `do` notation:
367- Associativity: `do { z <- do { y <- x ; f y } ; g z } = do { k <- x ; do { y <- f k ; g y } }`
367- Associativity: `do { z <- do { y <- x ; f y } ; g z } = do { k <- x ; do { y <- f k ; g y } }`
@@ -388,7 +388,7 @@ represent type constructors which support sequential composition, and also lifti
388- Left Identity: `pure x >>= f = f x`
388- Left Identity: `pure x >>= f = f x`
389- Right Identity: `x >>= pure = x`
389- Right Identity: `x >>= pure = x`
391−Or, expressed using `do` notation:
391+Or, expressed using `do` notation:
393- Left Identity: `do { y <- pure x ; f y } = f x`
393- Left Identity: `do { y <- pure x ; f y } = f x`
394- Right Identity: `do { y <- x ; pure y } = x`
394- Right Identity: `do { y <- x ; pure y } = x`
@@ -612,21 +612,7 @@ The `Eq` type class represents types which support decidable equality.
612- Transitivity: if `x == y` and `y == z` then `x == z`
612- Transitivity: if `x == y` and `y == z` then `x == z`
613- Negation: `x /= y = not (x == y)`
613- Negation: `x /= y = not (x == y)`
615−`(/=)` may be implemented in terms of `(==)`, but it might give a performance improvement to implement it separately.
615+`(/=)` may be implemented in terms of `(==)`, but it might give a performance improvement to implement it separately.
620−refEq :: forall a. a -> a -> Boolean
627−refIneq :: forall a. a -> a -> Boolean
631#### `eqUnit`
617#### `eqUnit`
@@ -782,49 +768,170 @@ instance ordArray :: (Ord a) => Ord [a]
785−#### `Bits`
771+#### `Bounded`
787``` purescript
773``` purescript
788−class Bits b where
774+class (Ord a) <= Bounded a where
789− (.&.) :: b -> b -> b
775+ top :: a
790− (.|.) :: b -> b -> b
776+ bottom :: a
791− (.^.) :: b -> b -> b
792− shl :: b -> Number -> b
793− shr :: b -> Number -> b
794− zshr :: b -> Number -> b
795− complement :: b -> b
798−The `Bits` type class identifies types which support bitwise operations.
779+The `Bounded` type class represents types that are finite partially
800−#### `bitsNumber`
782+Instances should satisfy the following law in addition to the `Ord` laws:
784+- Ordering: `bottom <= a <= top`
786+#### `boundedBoolean`
802``` purescript
788``` purescript
803−instance bitsNumber :: Bits Number
789+instance boundedBoolean :: Bounded Boolean
796+class (Ord a) <= Lattice a where
801+The `Lattice` type class represents types that are partially ordered
802+sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
804+Instances should satisfy the following laws in addition to the `Ord`
808+ - `a || (b || c) = (a || b) || c`
809+ - `a && (b && c) = (a && b) && c`
814+ - `a || (a && b) = a`
815+ - `a && (a || b) = a`
820+#### `latticeBoolean`
823+instance latticeBoolean :: Lattice Boolean
827+#### `BoundedLattice`
830+class (Bounded a, Lattice a) <= BoundedLattice a where
833+The `BoundedLattice` type class represents types that are finite
836+Instances should satisfy the following law in addition to the `Lattice`
844+ - `a && bottom = bottom`
807−#### `BoolLike`
846+#### `boundedLatticeBoolean`
809``` purescript
848``` purescript
810−class BoolLike b where
849+instance boundedLatticeBoolean :: BoundedLattice Boolean
816−The `BoolLike` type class identifies types which support Boolean operations.
818−`BoolLike` instances are required to satisfy the laws of a _Boolean algebra_.
853+#### `ComplementedLattice`
856+class (BoundedLattice a) <= ComplementedLattice a where
860+The `ComplementedLattice` type class represents types that are lattices
861+where every member is also uniquely complemented.
821−#### `boolLikeBoolean`
863+Instances should satisfy the following law in addition to the
864+`BoundedLattice` laws:
867+ - `not a || a == top`
868+ - `not a && a == bottom`
870+ - `not <<< not == id`
872+#### `complementedLatticeBoolean`
823``` purescript
874``` purescript
824−instance boolLikeBoolean :: BoolLike Boolean
875+instance complementedLatticeBoolean :: ComplementedLattice Boolean
879+#### `DistributiveLattice`
882+class (Lattice a) <= DistributiveLattice a where
885+The `DistributiveLattice` type class represents types that are lattices
886+where the `&&` and `||` distribute over each other.
888+Instances should satisfy the following law in addition to the `Lattice`
891+- Distributivity: `x && (y || z) = (x && y) || (x && z)`
893+#### `distributiveLatticeBoolean`
896+instance distributiveLatticeBoolean :: DistributiveLattice Boolean
900+#### `BooleanAlgebra`
903+class (ComplementedLattice a, DistributiveLattice a) <= BooleanAlgebra a where
906+The `BooleanAlgebra` type class represents types that are Boolean
907+algebras, also known as Boolean lattices.
909+Instances should satisfy the `ComplementedLattice` and
910+`DistributiveLattice` laws.
912+#### `booleanAlgebraBoolean`
915+instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
922+(||) :: forall a. (Lattice a) => a -> a -> a
930+(&&) :: forall a. (Lattice a) => a -> a -> a
828#### `Semigroup`
935#### `Semigroup`
830``` purescript
937``` purescript
@@ -838,7 +945,7 @@ The `Semigroup` type class identifies an associative operation on a type.
839- Associativity: `(x <> y) <> z = x <> (y <> z)`
946- Associativity: `(x <> y) <> z = x <> (y <> z)`
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.
843#### `semigroupUnit`
950#### `semigroupUnit`
@@ -869,6 +976,28 @@ instance semigroupArr :: (Semigroup s') => Semigroup (s -> s')
870`(++)` is an alias for `(<>)`.
977`(++)` is an alias for `(<>)`.
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
992+The `Bits` type class identifies types which support bitwise operations.
997+instance bitsNumber :: Bits Number
873## Module Data.Function
1002## Module Data.Function
@@ -1243,7 +1372,7 @@ untilE :: forall e. Eff e Boolean -> Eff e Unit
1244Loop until a condition becomes `true`.
1373Loop until a condition becomes `true`.
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`,
1247until its return value is `true`.
1376until its return value is `true`.
1249#### `whileE`
1378#### `whileE`
@@ -1254,7 +1383,7 @@ whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
1255Loop while a condition is `true`.
1384Loop while a condition is `true`.
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
1258`true`, it runs the effectful computation `m` and loops. If not, the computation ends.
1387`true`, it runs the effectful computation `m` and loops. If not, the computation ends.
1260#### `forE`
1389#### `forE`