ByteIo

ByteIo :: # (opaque)

Constructors for the two-effect byte stream that execution drives. The type itself is Execute.ByteIo; these helpers save every platform integration from re-deriving the same read/write wiring by hand.

A ByteIo is an already-open, exclusive, ordered duplex byte stream, and it is the only thing a platform must supply. It owns no lifecycle: connection creation, TLS, deadlines, retries, and pooling remain the platform's concern.

new : { read! : U64 => Try(Read, read_err), write_all! : List(U8) => Try({  }, write_err) } -> ByteIo(read_err, write_err)

Wrap read!/write_all! that already speak the Data/End read protocol. Use this when the platform distinguishes a genuine end of stream from a short read itself.

from_empty_eof : { read_bytes! : U64 => Try(List(U8), read_err), write_all! : List(U8) => Try({  }, write_err) } -> ByteIo(read_err, write_err)

Adapt a raw byte reader whose empty result means end of stream, folding a convention that every integration otherwise repeats by hand. The name states the requirement: this is correct only where the platform returns Err on timeout/would-block and reserves [] for a genuine end of stream. Otherwise use new with an explicit Data/End mapping.