Skip to content

Commit 66be7a2

Browse files
authored
Merge pull request #144 from matthewleon/NonEmpty-Derive-Foldable1
NonEmptyList: newtype derive Foldable1
2 parents a49621c + 34e83ce commit 66be7a2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Data/List/Types.purs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,7 @@ derive newtype instance foldableNonEmptyList :: Foldable NonEmptyList
211211

212212
derive newtype instance traversableNonEmptyList :: Traversable NonEmptyList
213213

214-
instance foldable1NonEmptyList :: Foldable1 NonEmptyList where
215-
fold1 (NonEmptyList (a :| as)) =
216-
foldl append a as
217-
foldMap1 f (NonEmptyList (a :| as)) =
218-
foldl (\acc -> append acc <<< f) (f a) as
214+
derive newtype instance foldable1NonEmptyList :: Foldable1 NonEmptyList
219215

220216
instance traversable1NonEmptyList :: Traversable1 NonEmptyList where
221217
traverse1 f (NonEmptyList (a :| as)) =

0 commit comments

Comments
 (0)