Skip to content

Commit 82c1738

Browse files
phadejtreeowl
authored andcommitted
Implement foldMap for ViewL
1 parent e3253fc commit 82c1738

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

containers/src/Data/Sequence/Internal.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,9 @@ instance Functor ViewL where
21922192
fmap f (x :< xs) = f x :< fmap f xs
21932193

21942194
instance Foldable ViewL where
2195+
foldMap _ EmptyL = mempty
2196+
foldMap f (x :< xs) = f x <> foldMap f xs
2197+
21952198
foldr _ z EmptyL = z
21962199
foldr f z (x :< xs) = f x (foldr f z xs)
21972200

0 commit comments

Comments
 (0)