method StreamClass.prototype.partition
Private
StreamClass.prototype.partition(): Task<{ values: T[]; errors: E[]; }, never>

Splits the stream into { values, errors }, keeping both — Result.partition, fed by the stream. Literally results() piped through partition: the three modules share one vocabulary, so the composition is one line.

import * as Failure from '../result/failure.ts';

const Bad = Failure.define('Bad', 'bad element');
const { values, errors } = await Stream.from([1, Bad(), 2]).partition();
values; // [1, 2]
errors.length; // 1

Return Type

Task<{ values: T[]; errors: E[]; }, never>

Usage

import { StreamClass } from "lib/stream/stream.ts";