Manuscript Documentation
v2026.12.0

@std/io/steps.ms#

Import each required symbol with import Name from "@std/io/steps.ms".

filter Function#

Returns a stream of the items of input for which keep is true, in order. Closing it closes input.

Manuscript
fn filter[T](move input ReadStream[T], move keep fn(T) Bool) ReadStream[T] { ... }

lines Function#

Reads lines of text from a byte stream such as stdin(). It splits input at \n and removes a trailing \r. A line longer than max_bytes returns EOVERFLOW, and a line that is not valid UTF-8 returns EBADMSG.

Manuscript
fn lines(move input ReadStream[Bytes], max_bytes Int? = null) ReadStream[String] { ... }

map Function#

Returns a stream of f applied to each item of input. Closing it closes input.

Manuscript
fn map[T, U](move input ReadStream[T], move f fn(T) U) ReadStream[U] { ... }

take Function#

Returns a stream of at most the first count items of input, then the end. Later items are never read, so take can end an endless stream. A failed read does not count as an item. A count of 0 or less gives an empty stream. Closing it closes input.

Manuscript
fn take[T](move input ReadStream[T], count Int) ReadStream[T] { ... }