hgeometry-combinatorial-0.12.0.1: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Sequence.Util

Description

 
Synopsis

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.