tomjaguarpaw / tilapia

Improving all Haskell's programmer interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Splitting functions should return non-empty list

tomjaguarpaw opened this issue · comments

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

Another function that needs this is the one that gives all permutations. See also this issue to Relude.