list-extra icon indicating copy to clipboard operation
list-extra copied to clipboard

Cycle 0 list = [] ?

Open bitterjug opened this issue 4 years ago • 1 comments
trafficstars

If the cycle length is zero, shouldn't we be returning a list of length zero? https://github.com/elm-community/list-extra/blob/7ae12a5da9c1337188b415d70bc0d49df2db61b3/src/List/Extra.elm#L205

bitterjug avatar Jul 01 '21 12:07 bitterjug

Yes, and I think that is the case, because cycleLength comes from the List.length of input list. So when cycleLength is zero, the input list is returned, which was necessarily an empty list.

Chadtech avatar Jul 01 '21 21:07 Chadtech