<html><head></head><body><div>No. Functions like foldl1 are named such because they start building a value with the first (“1”) value of a list and consequently do not work with empty lists. They have counterparts without the “1” in their names, which receive the initial value as an extra argument. Things are completely different with cycle1, which does not even take a list.</div><div><br></div><div>All the best,</div><div>Wolfgang</div><div><br></div><div>Am Dienstag, den 12.09.2017, 09:19 +0200 schrieb Sebastian Graf:</div><blockquote type="cite"><div dir="ltr">It's the same convention as with other Semigroup-like functions, such as `foldl1`, `scanl1`, etc.<br><div>Doesn't really makes sense to distinguish between `cycle` and `cycle1` in this case, but that's just bike shedding.</div><div><br></div><div>Also, at some point in the future, `cycle` can go in `Data.OldList` and be replaced by `cycle1`, renamed accordingly.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 11, 2017 at 10:12 PM, Wolfgang Jeltsch <span dir="ltr"><<a href="mailto:wolfgang-it@jeltsch.info" target="_blank">wolfgang-it@jeltsch.info</a>></span> wrote:<br><blockquote type="cite">Am Montag, den 11.09.2017, 06:55 +0530 schrieb Harendra Kumar:<br>
<span class="">> On 11 September 2017 at 02:46, Wolfgang Jeltsch wrote:<br>
> > Am Sonntag, den 10.09.2017, 10:39 +0200 schrieb Herbert Valerio<br>
> > Riedel:<br>
> > > What you seem to be searching for looks more like what we know as<br>
> > > `cycle :: [a] -> [a]`, and in fact there is its generalisation at<br>
> > ><br>
> > > <a href="http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Semigroup.html#v:cycle1" rel="noreferrer" target="_blank">http://hackage.haskell.org/<wbr>package/base-4.10.0.0/docs/<wbr>Data-Semigroup.html#v:cycle1</a><br>
> ><br>
> > Why is this function called cycle1, not cycle? What does the “1”<br>
> > stand for?<br>
><br>
> I guess this is not named "cycle" to avoid conflict with<br>
> "Data.List.cycle".<br>
<br>
</span>Why? We have qualified imports. It seems very wrong to add single<br>
characters to identifiers to denote name spaces.<br>
<span class=""><br>
> I was also wondering why it is "cycle1" instead of, say "scycle". It<br>
> can be thought of as cycling just one value instead of cycling a list<br>
> in case of "Data.List.cycle".<br>
<br>
</span>Also Data.List.cycle cycles only one value. It is just that this single<br>
value happens to be a list. If you specialize cycle1 to the list monoid,<br>
you get exactly Data.List.cycle.<br>
<div class="HOEnZb"><div class="h5"><br>
All the best,<br>
Wolfgang<br>
______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
</div></div><br></blockquote></div><br></div>
</blockquote></body></html>