splitwhen

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],[]]
splitWhen splits a sequence 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. The number of resulting components is greater by one than number of separators. Since 0.9.3
Split on elements satisfying the given predicate. Equivalent to split . dropDelims . whenElt. For example:
>>> splitWhen (<0) (BV.fromList [1,3,-4,5,7,-9,0,2])
[[1,3],[5,7],[0,2]]
Monadic variant of break. Consumes items from the list until a condition holds.