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 1de5713 commit d30146eCopy full SHA for d30146e
src/Data/Foldable.purs
@@ -240,6 +240,16 @@ oneOfMap f = foldr (alt <<< f) empty
240
241
-- | Fold a data structure, accumulating values in some `Monoid`,
242
-- | combining adjacent elements using the specified separator.
243
+-- |
244
+-- | For example:
245
246
+-- | ```purescript
247
+-- | > intercalate ", " ["Lorem", "ipsum", "dolor"]
248
+-- | = "Lorem, ipsum, dolor"
249
250
+-- | > intercalate "*" ["a", "b", "c"]
251
+-- | = "a*b*c"
252
+-- | ```
253
intercalate :: forall f m. Foldable f => Monoid m => m -> f m -> m
254
intercalate sep xs = (foldl go { init: true, acc: mempty } xs).acc
255
where
0 commit comments