@@ -12,13 +12,15 @@ import Control.Lazy (class Lazy, defer)
1212import Data.Bifoldable (class Bifoldable )
1313import Data.Bifunctor (class Bifunctor )
1414import Data.Bitraversable (class Bitraversable )
15+ import Data.Eq (class Eq1 )
1516import Data.Foldable (class Foldable , foldMap )
1617import Data.Functor.Invariant (class Invariant , imapF )
1718import Data.HeytingAlgebra (implies , ff , tt )
1819import Data.Maybe (Maybe (..))
1920import Data.Maybe.First (First (..))
2021import Data.Monoid (class Monoid , mempty )
2122import Data.Newtype (unwrap )
23+ import Data.Ord (class Ord1 )
2224import Data.Traversable (class Traversable )
2325
2426-- | A simple product type for wrapping a pair of component values.
@@ -33,12 +35,16 @@ instance showTuple :: (Show a, Show b) => Show (Tuple a b) where
3335-- | there are `Eq` instances for both component types.
3436derive instance eqTuple :: (Eq a , Eq b ) => Eq (Tuple a b )
3537
38+ instance eq1Tuple :: Eq a => Eq1 (Tuple a ) where eq1 = eq
39+
3640-- | Allows `Tuple`s to be compared with `compare`, `>`, `>=`, `<` and `<=`
3741-- | whenever there are `Ord` instances for both component types. To obtain
3842-- | the result, the `fst`s are `compare`d, and if they are `EQ`ual, the
3943-- | `snd`s are `compare`d.
4044derive instance ordTuple :: (Ord a , Ord b ) => Ord (Tuple a b )
4145
46+ instance ord1Tuple :: Ord a => Ord1 (Tuple a ) where compare1 = compare
47+
4248instance boundedTuple :: (Bounded a , Bounded b ) => Bounded (Tuple a b ) where
4349 top = Tuple top top
4450 bottom = Tuple bottom bottom
0 commit comments