Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- splitMonotone :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
Documentation
splitMonotone :: (a -> Bool) -> Seq a -> (Seq a, Seq a) Source #
Partition the seq s given a monotone predicate p into (xs,ys) such that
all elements in xs do *not* satisfy the predicate p all elements in ys do satisfy the predicate p
all elements in s occur in either xs or ys.
running time: \(O(\log^2 n + T*\log n)\), where \(T\) is the time to execute the predicate.