dropWhile

dropWhile p xs returns the suffix remaining after takeWhile p xs.

Examples

>>> dropWhile (< 3) [1,2,3,4,5,1,2,3]
[3,4,5,1,2,3]
>>> dropWhile (< 9) [1,2,3]
[]
>>> dropWhile (< 0) [1,2,3]
[1,2,3]
dropWhile p xs returns the suffix remaining after takeWhile p xs.
Similar to dropWhile, drops the longest (possibly empty) prefix of elements satisfying the predicate and returns the remainder.
dropWhile p xs returns the suffix remaining after takeWhile p xs.
Similar to dropWhile, drops the longest (possibly empty) prefix of elements satisfying the predicate and returns the remainder. Note: copies the entire byte array
O(n) dropWhile p t returns the suffix remaining after takeWhile p t.
dropWhile p xs returns the suffix remaining after takeWhile p xs. Properties
unstream . dropWhile p . stream = dropWhile p
Drop all values which match the given predicate. Note: you likely want to use it with monadic composition. See the docs for drop.
dropWhile p xs returns the suffix remaining after takeWhile p xs.
>>> dropWhile (< 3) [1,2,3,4,5,1,2,3]
[3,4,5,1,2,3]

>>> dropWhile (< 9) [1,2,3]
[]

>>> dropWhile (< 0) [1,2,3]
[1,2,3]
Ignore all bytes while the predicate returns True. Since 0.3.0
Since 1.0.8
(dropWhile p) discards values going downstream until one violates the predicate p.
dropWhile (pure False) = cat

dropWhile (liftA2 (||) p1 p2) = dropWhile p1 >-> dropWhile p2
Remove the longest suffix of elements satisfying p. In contrast to reverse . dropWhile p . reverse this works for infinite lists, too.
forAllPredicates $ \p xs -> Rev.dropWhile p xs == reverse (List.dropWhile p (reverse xs))
\x xs pad -> defined $ Match.take (pad::[()]) $ Rev.dropWhile ((x::Char)/=) $ cycle $ x:xs
forAllPredicates $ \p xs -> Rev.dropWhile p xs == reverse (List.dropWhile p (reverse xs))
\x xs pad -> defined $ length $ Rev.dropWhile ((x::Char)/=) $ Match.replicate (pad::[()]) undefined ++ x:xs
Ignore elements of a stream until a test succeeds, retaining the rest.
>>> S.print $ S.dropWhile ((< 5) . length) S.stdinLn
one<Enter>
two<Enter>
three<Enter>
"three"
four<Enter>
"four"
^CInterrupted.
dropWhile p xs returns the suffix remaining after takeWhile p xs.
dropWhile p xs returns the suffix remaining after takeWhile p xs:
dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
dropWhile (< 9) [1,2,3] == []
dropWhile (< 0) [1,2,3] == [1,2,3]
O(n) dropWhile p t returns the suffix remaining after takeWhile p t. Subject to fusion.
O(n) Drop the longest prefix of elements that satisfy the predicate without copying.
O(n) Drop the longest prefix of elements that satisfy the predicate without copying.
O(n) Drop the longest prefix of elements that satisfy the predicate without copying.
O(n) Drop the longest prefix of elements that satisfy the predicate without copying.
dropWhile returns the suffix remaining after takeWhile.
> dropWhile (< 3) [1,2,3,4,5,1,2,3]
[3,4,5,1,2,3]

> dropWhile (< z) (fromList "abc" :: Text)
""
Remove longest prefix satisfying given predicate.
dropWhile p t == snd (span p t)
>>> dropWhile (< 'c') "abcdabcd"
"cdabcd"