Navigation

Limit

Stream limiting: take, takeWhile, drop.

drop

drop: skip the first n elements and forward the remainder unchanged; non-positive n is a no-op.

drop : Int -> Computation (Step r a) -> Computation (Step r a)

Skip the first n elements of a stream. Non-positive n is a no-op.

take

take: yield at most the first n elements of a stream, then Done null; non-positive n yields the empty stream immediately.

take : Int -> Computation (Step r a) -> Computation (Step null a)

Take the first n elements of a stream. Non-positive n yields the empty stream.

takeWhile

takeWhile: yield prefix elements while the predicate holds; terminates on the first element that fails the predicate.

takeWhile : (a -> Bool) -> Computation (Step r a) -> Computation (Step null a)

Take elements while a predicate holds. The first element that fails the predicate is discarded along with everything after.