@@ -593,6 +593,13 @@ module Prelude
593593 (==) = eqArrayImpl (==)
594594 (/=) xs ys = not (xs == ys)
595595
596+ instance eqOrdering :: Eq Ordering where
597+ (==) LT LT = true
598+ (==) GT GT = true
599+ (==) EQ EQ = true
600+ (==) _ _ = false
601+ (/=) x y = not (x == y)
602+
596603 foreign import refEq
597604 """
598605 function refEq(r1) {
@@ -667,12 +674,14 @@ module Prelude
667674 EQ -> compare xs ys
668675 other -> other
669676
670− instance eqOrdering :: Eq Ordering where
671− (==) LT LT = true
672− (==) GT GT = true
673− (==) EQ EQ = true
674− (==) _ _ = false
675− (/=) x y = not (x == y)
677+ instance ordOrdering :: Ord Ordering where
678+ compare LT LT = EQ
679+ compare EQ EQ = EQ
680+ compare GT GT = EQ
681+ compare LT _ = LT
682+ compare EQ LT = GT
683+ compare EQ GT = LT
684+ compare GT _ = GT
676685
677686 infixl 4 <
678687 infixl 4 >
@@ -739,6 +748,10 @@ module Prelude
739748 top = unit
740749 bottom = unit
741750
751+ instance boundedOrdering :: Bounded Ordering where
752+ top = GT
753+ bottom = LT
754+
742755 -- | The `Lattice` type class represents types that are partially ordered
743756 -- | sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
744757 -- |
@@ -765,6 +778,10 @@ module Prelude
765778 sup = boolOr
766779 inf = boolAnd
767780
781+ instance latticeUnit :: Lattice Unit where
782+ sup _ _ = unit
783+ inf _ _ = unit
784+
768785 infixr 2 ||
769786 infixr 3 &&
770787
@@ -792,6 +809,8 @@ module Prelude
792809
793810 instance boundedLatticeBoolean :: BoundedLattice Boolean
794811
812+ instance boundedLatticeUnit :: BoundedLattice Unit
813+
795814 -- | The `ComplementedLattice` type class represents types that are lattices
796815 -- | where every member is also uniquely complemented.
797816 -- |
@@ -809,6 +828,9 @@ module Prelude
809828 instance complementedLatticeBoolean :: ComplementedLattice Boolean where
810829 not = boolNot
811830
831+ instance complementedLatticeUnit :: ComplementedLattice Unit where
832+ not _ = unit
833+
812834 -- | The `DistributiveLattice` type class represents types that are lattices
813835 -- | where the `&&` and `||` distribute over each other.
814836 -- |
@@ -820,6 +842,8 @@ module Prelude
820842
821843 instance distributiveLatticeBoolean :: DistributiveLattice Boolean
822844
845+ instance distributiveLatticeUnit :: DistributiveLattice Unit
846+
823847 -- | The `BooleanAlgebra` type class represents types that are Boolean
824848 -- | algebras, also known as Boolean lattices.
825849 -- |
@@ -829,6 +853,8 @@ module Prelude
829853
830854 instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
831855
856+ instance booleanAlgebraUnit :: BooleanAlgebra Unit
857+
832858 foreign import boolOr
833859 """
834860 function boolOr(b1) {