Skip to content

Commit 76ff0b0

Browse files
committed
Use Eq1 and Ord1 constraints consistently
1 parent 8b51898 commit 76ff0b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Data/NonEmpty.purs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ tail (_ :| xs) = xs
7070
instance showNonEmpty :: (Show a, Show (f a)) => Show (NonEmpty f a) where
7171
show (a :| fa) = "(NonEmpty " <> show a <> " " <> show fa <> ")"
7272

73-
derive instance eqNonEmpty :: (Eq a, Eq (f a)) => Eq (NonEmpty f a)
73+
instance eqNonEmpty :: (Eq1 f, Eq a) => Eq (NonEmpty f a) where
74+
eq = eq1
7475

7576
instance eq1NonEmpty :: Eq1 f => Eq1 (NonEmpty f) where
7677
eq1 (NonEmpty a fa) (NonEmpty b fb) = a == b && fa `eq1` fb
7778

78-
derive instance ordNonEmpty :: (Ord a, Ord (f a)) => Ord (NonEmpty f a)
79+
instance ordNonEmpty :: (Ord1 f, Ord a) => Ord (NonEmpty f a) where
80+
compare = compare1
7981

8082
instance ord1NonEmpty :: Ord1 f => Ord1 (NonEmpty f) where
8183
compare1 (NonEmpty a fa) (NonEmpty b fb) =

0 commit comments

Comments
 (0)