Where is the join function?

I need a join function to add separators between list members. I found this function in Data.List.Utils and Data.String.Utils. Unfortunately, these modules do not seem to be part of the standard platform.
Since this is a fairly standard feature, I'm sure it should be somewhere on a standard platform, possibly with a different name.

Any idea?

Update

I found a solution (but can not accept my answer, I have to wait 2 days ???)

+3
source share
2 answers

I found it (thanks Hoogle), it's called intercalate.

+14
source

Data.List intersperse, a -> [a] -> [a] intercalate, [a] -> [[a]] -> [a]

:
intersperse '_' "foo" "f_o_o"
intercalate "baa" ["f", "o", "o"] "fbaaobaaobaa"

+7

Source: https://habr.com/ru/post/1761482/


All Articles