fn main { let iter = [1, 2, 3, 4, 5] |> @iter.from_array while iter.next() is Some(v) && v <= 3 { println(v) } // => [1, 2, 3]}
pub struct T[A] { run : () -> A?}
impl Show for T[A]
fn[A : Show] output(self : T[A], logger : Logger) -> Unit
fn[A] T::append(self : T[A], other : A) -> T[A]
fn[A] T::collect(self : T[A]) -> Array[A]
fn[A] T::concat(self : T[A], other : T[A]) -> T[A]
fn[A] T::count(self : T[A]) -> Int
fn[A] T::drop(self : T[A], n : Int) -> T[A]
fn[A] T::drop_while(self : T[A], f : (A) -> Bool) -> T[A]
fn[A] T::each(self : T[A], f : (A) -> Unit) -> Unit
fn[A] T::eachi(self : T[A], f : (Int, A) -> Unit) -> Unit
fn[A] T::filter(self : T[A], f : (A) -> Bool) -> T[A]
fn[A, B] T::filter_map(self : T[A], f : (A) -> B?) -> T[B]
fn[A] T::find_first(self : T[A], pred : (A) -> Bool) -> A?
fn[A, B] T::flat_map(self : T[A], f : (A) -> T[B]) -> T[B]
fn[A] T::flatten(self : T[T[A]]) -> T[A]
fn[A, B] T::fold(self : T[A], init~ : B, f : (B, A) -> B) -> B
fn[A] T::intersperse(self : T[A], sep : A) -> T[A]
fn[A] T::iter(self : T[A]) -> Iter[A]
fn[A, B] T::iter2(self : T[(A, B)]) -> Iter2[A, B]
fn[A : Show] T::join(self : T[A], separator~ : String) -> String
fn[A] T::last(self : T[A]) -> A?
fn[A, B] T::map(self : T[A], f : (A) -> B) -> T[B]
fn[A, B] T::mapi(self : T[A], f : (Int, A) -> B) -> T[B]
fn[A : Compare + Eq] T::maximum(self : T[A]) -> A?
fn[A : Compare + Eq] T::minimum(self : T[A]) -> A?
fn[A] T::next(self : T[A]) -> A?
fn[A] T::nth(self : T[A], n : Int) -> A?
fn[A] T::op_add(self : T[A], other : T[A]) -> T[A]
fn[A] T::peek(self : T[A]) -> A?
fn[A] T::prepend(self : T[A], other : A) -> T[A]
fn[A] T::span(self : T[A], pred : (A) -> Bool) -> (T[A], T[A])
fn[A] T::take(self : T[A], n : Int) -> T[A]
fn[A] T::take_while(self : T[A], f : (A) -> Bool) -> T[A]
fn[A, E : Error] T::try_collect(self : T[Result[A, E]]) -> Array[A] raise E
fn[A, B] T::zip(self : T[A], other : T[B]) -> T[(A, B)]
fn[A] empty() -> T[A]
fn[A] from_array(array : Array[A]) -> T[A]
fn[A] from_iter(iter : Iter[A]) -> T[A]
fn[A] new(next : () -> A?) -> T[A]
fn range(start~ : Int, end? : Int, step? : Int, inclusive? : Bool) -> T[Int]
fn[A : Compare + Eq] range_by(start~ : A, end? : A, step~ : (A) -> A) -> T[A]
fn[A] repeat(a : A) -> T[A]
fn[A] repeat_by(f : () -> A) -> T[A]
fn[A] seq(init~ : A, step~ : (A) -> A, cond~ : (A) -> Bool) -> T[A]
fn[A] singleton(a : A) -> T[A]
fn[A, S] unfold(init~ : S, step~ : (S) -> (A, S)?) -> T[A]
fn[A, S] unfold_eager(init~ : S, step~ : (S) -> (A, S)?) -> T[A]
Install
Powered by MoonBit
© 2026 mooncakes.io