How do you use Data.Text.intersperse :: Char -> Text -> Text?

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sun Jun 27 05:37:18 UTC 2021


On Sun, 27 Jun 2021 at 12:44, Andreas Abel <andreas.abel at ifi.lmu.de> wrote:

>  > `intersperse :: Char -> Text -> Text`
>
> Yeah, that looks silly indeed.  Should be pruned or marked as spam.
>

"Spam" is a bit harsh.  And it does indeed have some use (albeit primarily
with test suites and quite possibly more efficient ways to do the required
task anyway):
https://github.com/search?l=Haskell&q=Text.intersperse&type=Code



>
> On 2021-06-27 01:33, Andrew Lelechenko wrote:
> > I know applications for `intercalate :: Text -> [Text] -> Text`:
> `unwords`, `unlines`, etc. But what is `intersperse :: Char -> Text ->
> Text` good for? Am I correct assuming that its sole merit is to mimic
> `Data.List` API? Note that `Data.List.intersperse` is polymorphic and is
> exceedingly rarely used for `Char -> String -> String`.
> >
> > Best regards,
> > Andrew
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20210627/1d403952/attachment.html>


More information about the Libraries mailing list