We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1deede0 commit 08ca8e7Copy full SHA for 08ca8e7
src/Data/Foldable.purs
@@ -71,10 +71,10 @@ mconcat :: forall f m. (Foldable f, Monoid m) => f m -> m
71
mconcat = foldl (<>) mempty
72
73
intercalate :: forall f m. (Foldable f, Monoid m) => m -> f m -> m
74
-intercalate sep xs = (foldr go { init: true, acc: mempty } xs).acc
+intercalate sep xs = (foldl go { init: true, acc: mempty } xs).acc
75
where
76
- go x { init = init } | init = { init: false, acc: x }
77
- go x { acc = acc } = { init: false, acc: x <> sep <> acc }
+ go { init = true } x = { init: false, acc: x }
+ go { acc = acc } x = { init: false, acc: acc <> sep <> x }
78
79
and :: forall f. (Foldable f) => f Boolean -> Boolean
80
and = foldl (&&) true
0 commit comments