elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 59 forks source link

`groupsOfVarying` behaves inconsistently with groups of length `0` #156

Open rjdellecese opened 2 years ago

rjdellecese commented 2 years ago
> import List.Extra as List
> List.groupsOfVarying [0, 1] ["a"]
[[],["a"]] : List (List String)
> List.groupsOfVarying [1, 0] ["a"]
[["a"]] : List (List String)

I would expect the second expression to evaluate to [["a"], []]. But at the very least, I would expect the two to be symmetrical!