stream

Types

pub opaque type Stream(t)

Values

pub fn copy(original: Stream(t)) -> Stream(t)
pub fn drop(from stream: Stream(a), up_to n: Int) -> Stream(a)
pub fn drop_while(
  in stream: Stream(a),
  satisfying predicate: fn(a) -> Bool,
) -> Stream(a)
pub fn each(from: Stream(t), do: fn(t) -> Nil) -> Nil
pub fn empty() -> Stream(t)
pub fn filter(
  from: Stream(t),
  keeping predicate: fn(t) -> Bool,
) -> Stream(t)
pub fn flat_map(
  from stream: Stream(Int),
  by fun: fn(Int) -> Stream(Int),
) -> Stream(Int)
pub fn flatten(streams: Stream(Stream(Int))) -> Stream(Int)
pub fn fold(
  over stream: Stream(t),
  from initial: acc,
  with fun: fn(acc, t) -> acc,
) -> acc
pub fn from_list(values: List(t)) -> Stream(t)
pub fn generate(seed: fn() -> t, by: fn(t) -> t) -> Stream(t)
pub fn generate_until(
  seed seed: fn() -> t,
  by generate: fn(t) -> t,
  until until: fn(t) -> Bool,
) -> Stream(t)
pub fn has_next(generator: Stream(t)) -> Bool
pub fn map(from: Stream(t), by: fn(t) -> r) -> Stream(r)
pub fn next(generator: Stream(t)) -> option.Option(t)
pub fn to_list(from: Stream(t)) -> List(t)
pub fn until(from: Stream(t), until: fn(t) -> Bool) -> Stream(t)
Search Document