Skip to content

Commit e992892

Browse files
authored
Add Eq1 Ord1 to NonEmptyList LazyNonEmptyList (#188)
* Add Eq1 Ord1 to NonEmptyList * Add Eq1 Ord1 to Lazy NonEmptyList * Fix Eq1 Ord1 for Lazy NonEmptyList * Update changelog
1 parent 6d8e30e commit e992892

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Notable changes to this project are documented in this file. The format is based
77
Breaking changes:
88

99
New features:
10+
- Added `Eq1` and `Ord1` instances to `NonEmptyList` and `LazyNonEmptyList` (#188)
1011

1112
Bugfixes:
1213

src/Data/List/Lazy/Types.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ derive instance newtypeNonEmptyList :: Newtype (NonEmptyList a) _
211211
derive newtype instance eqNonEmptyList :: Eq a => Eq (NonEmptyList a)
212212
derive newtype instance ordNonEmptyList :: Ord a => Ord (NonEmptyList a)
213213

214+
instance eq1NonEmptyList :: Eq1 NonEmptyList where
215+
eq1 (NonEmptyList lhs) (NonEmptyList rhs) = eq1 lhs rhs
216+
217+
instance ord1NonEmptyList :: Ord1 NonEmptyList where
218+
compare1 (NonEmptyList lhs) (NonEmptyList rhs) = compare1 lhs rhs
219+
214220
instance showNonEmptyList :: Show a => Show (NonEmptyList a) where
215221
show (NonEmptyList nel) = "(NonEmptyList " <> show nel <> ")"
216222

src/Data/List/Types.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ derive instance newtypeNonEmptyList :: Newtype (NonEmptyList a) _
202202
derive newtype instance eqNonEmptyList :: Eq a => Eq (NonEmptyList a)
203203
derive newtype instance ordNonEmptyList :: Ord a => Ord (NonEmptyList a)
204204

205+
derive newtype instance eq1NonEmptyList :: Eq1 NonEmptyList
206+
derive newtype instance ord1NonEmptyList :: Ord1 NonEmptyList
207+
205208
instance showNonEmptyList :: Show a => Show (NonEmptyList a) where
206209
show (NonEmptyList nel) = "(NonEmptyList " <> show nel <> ")"
207210

0 commit comments

Comments
 (0)