Semigroup repeat (base package)

Harendra Kumar harendra.kumar at gmail.com
Sun Sep 10 07:24:24 UTC 2017


Hi,

I am sending this question here since base ships with ghc, let me know if
this is not the right forum for this.

I could not find a function that repeats a value using a semigroup append.
I am looking for something like this:

srepeat :: Semigroup a => a -> a
srepeat x = xs where xs = x <> xs

Is it already available somewhere? Does it make sense to add it to
Data.Semigroup?

Thanks,
Harendra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170910/2a0aeba1/attachment.html>


More information about the ghc-devs mailing list