@@ -12,13 +12,15 @@ import Control.Lazy (class Lazy, defer)
12
12
import Data.Bifoldable (class Bifoldable )
13
13
import Data.Bifunctor (class Bifunctor )
14
14
import Data.Bitraversable (class Bitraversable )
15
+ import Data.Eq (class Eq1 )
15
16
import Data.Foldable (class Foldable , foldMap )
16
17
import Data.Functor.Invariant (class Invariant , imapF )
17
18
import Data.HeytingAlgebra (implies , ff , tt )
18
19
import Data.Maybe (Maybe (..))
19
20
import Data.Maybe.First (First (..))
20
21
import Data.Monoid (class Monoid , mempty )
21
22
import Data.Newtype (unwrap )
23
+ import Data.Ord (class Ord1 )
22
24
import Data.Traversable (class Traversable )
23
25
24
26
-- | 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
33
35
-- | there are `Eq` instances for both component types.
34
36
derive instance eqTuple :: (Eq a , Eq b ) => Eq (Tuple a b )
35
37
38
+ instance eq1Tuple :: Eq a => Eq1 (Tuple a ) where eq1 = eq
39
+
36
40
-- | Allows `Tuple`s to be compared with `compare`, `>`, `>=`, `<` and `<=`
37
41
-- | whenever there are `Ord` instances for both component types. To obtain
38
42
-- | the result, the `fst`s are `compare`d, and if they are `EQ`ual, the
39
43
-- | `snd`s are `compare`d.
40
44
derive instance ordTuple :: (Ord a , Ord b ) => Ord (Tuple a b )
41
45
46
+ instance ord1Tuple :: Ord a => Ord1 (Tuple a ) where compare1 = compare
47
+
42
48
instance boundedTuple :: (Bounded a , Bounded b ) => Bounded (Tuple a b ) where
43
49
top = Tuple top top
44
50
bottom = Tuple bottom bottom
0 commit comments