Splitting functions should return non-empty list
tomjaguarpaw opened this issue · comments
tomjaguarpaw commented
A property of splitting should be that the output list contains n + 1 elements where there were n boundaries in the input. Therefore the output list should have length at least 1.
The functions in Data.List need this treatment, for example
https://hackage.haskell.org/package/text-1.2.3.1/docs/Data-Text.html#v:splitOn
Ignat Insarov commented
Another function that needs this is the one that gives all permutations. See also this issue to Relude.