Semigroup repeat (base package)

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


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list