:: (a -> Bool) -> [a] -> [[a]] package:extra

A variant of words with a custom test. In particular, adjacent separators are discarded, as are leading or trailing separators.
wordsBy (== ':') "::xyz:abc::123::" == ["xyz","abc","123"]
\s -> wordsBy isSpace s == words s
A variant of lines with a custom test. In particular, if there is a trailing separator it will be discarded.
linesBy (== ':') "::xyz:abc::123::" == ["","","xyz","abc","","123",""]
\s -> linesBy (== '\n') s == lines s
linesBy (== ';') "my;list;here;" == ["my","list","here"]
Splits a list into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output.
split (== 'a') "aabbaca" == ["","","bb","c",""]
split (== 'a') ""        == [""]
split (== ':') "::xyz:abc::123::" == ["","","xyz","abc","","123","",""]
split (== ',') "my,list,here" == ["my","list","here"]
A combination of group and sort, using a part of the value to compare on.
groupSortOn length ["test","of","sized","item"] == [["of"],["test","item"],["sized"]]
A version of group where the equality is done on some extracted value.
groupOn abs [1,-1,2] == [[1,-1], [2]]