when package:split

A splitting strategy that splits on any elements that satisfy the given predicate.
>>> split (whenElt (<0)) [2,4,-3,6,-9,1 :: Int]
[[2,4],[-3],[6],[-9],[1]]
Split on elements satisfying the given predicate. Equivalent to split . dropDelims . whenElt.
>>> splitWhen (<0) [1,3,-4,5,7,-9,0,2]
[[1,3],[5,7],[0,2]]
>>> splitWhen (<0) [1,-2,3,4,-5,-6,7,8,-9]
[[1],[3,4],[],[7,8],[]]