@@ -593,6 +593,13 @@ module Prelude
593 (==) = eqArrayImpl (==)
593 (==) = eqArrayImpl (==)
594 (/=) xs ys = not (xs == ys)
594 (/=) xs ys = not (xs == ys)
596+ instance eqOrdering :: Eq Ordering where
601+ (/=) x y = not (x == y)
596 foreign import refEq
603 foreign import refEq
598 function refEq(r1) {
605 function refEq(r1) {
@@ -667,12 +674,14 @@ module Prelude
667 EQ -> compare xs ys
674 EQ -> compare xs ys
668 other -> other
675 other -> other
670− instance eqOrdering :: Eq Ordering where
677+ instance ordOrdering :: Ord Ordering where
671− (==) LT LT = true
678+ compare LT LT = EQ
672− (==) GT GT = true
679+ compare EQ EQ = EQ
673− (==) EQ EQ = true
680+ compare GT GT = EQ
674− (==) _ _ = false
681+ compare LT _ = LT
675− (/=) x y = not (x == y)
682+ compare EQ LT = GT
677 infixl 4 <
686 infixl 4 <
678 infixl 4 >
687 infixl 4 >
@@ -739,6 +748,10 @@ module Prelude
739 top = unit
748 top = unit
740 bottom = unit
749 bottom = unit
751+ instance boundedOrdering :: Bounded Ordering where
742 -- | The `Lattice` type class represents types that are partially ordered
755 -- | The `Lattice` type class represents types that are partially ordered
743 -- | sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
756 -- | sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
@@ -765,6 +778,10 @@ module Prelude
765 sup = boolOr
778 sup = boolOr
766 inf = boolAnd
779 inf = boolAnd
781+ instance latticeUnit :: Lattice Unit where
768 infixr 2 ||
785 infixr 2 ||
769 infixr 3 &&
786 infixr 3 &&
@@ -792,6 +809,8 @@ module Prelude
793 instance boundedLatticeBoolean :: BoundedLattice Boolean
810 instance boundedLatticeBoolean :: BoundedLattice Boolean
812+ instance boundedLatticeUnit :: BoundedLattice Unit
795 -- | The `ComplementedLattice` type class represents types that are lattices
814 -- | The `ComplementedLattice` type class represents types that are lattices
796 -- | where every member is also uniquely complemented.
815 -- | where every member is also uniquely complemented.
@@ -809,6 +828,9 @@ module Prelude
809 instance complementedLatticeBoolean :: ComplementedLattice Boolean where
828 instance complementedLatticeBoolean :: ComplementedLattice Boolean where
810 not = boolNot
829 not = boolNot
831+ instance complementedLatticeUnit :: ComplementedLattice Unit where
812 -- | The `DistributiveLattice` type class represents types that are lattices
834 -- | The `DistributiveLattice` type class represents types that are lattices
813 -- | where the `&&` and `||` distribute over each other.
835 -- | where the `&&` and `||` distribute over each other.
@@ -820,6 +842,8 @@ module Prelude
821 instance distributiveLatticeBoolean :: DistributiveLattice Boolean
843 instance distributiveLatticeBoolean :: DistributiveLattice Boolean
845+ instance distributiveLatticeUnit :: DistributiveLattice Unit
823 -- | The `BooleanAlgebra` type class represents types that are Boolean
847 -- | The `BooleanAlgebra` type class represents types that are Boolean
824 -- | algebras, also known as Boolean lattices.
848 -- | algebras, also known as Boolean lattices.
@@ -829,6 +853,8 @@ module Prelude
830 instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
854 instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
856+ instance booleanAlgebraUnit :: BooleanAlgebra Unit
832 foreign import boolOr
858 foreign import boolOr
834 function boolOr(b1) {
860 function boolOr(b1) {