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

Chop a list at the positions when the predicate holds. Contrary to wordsBy, consecutive separator elements will result in an empty segment in the result. O(n).
intercalate [x] (chopWhen (== x) xs) == xs