partitionMap
import { partitionMap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";Partition an Iterable into two Iterables based on an Either result. Right values go to the first Iterable, Left values to the second.
@example
import * as I from "./iterable.ts";
import * as E from "./either.ts";
const numbers = I.wrap(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
const [evens, odds] = I.partitionMap((n: number) =>
n % 2 === 0 ? E.right(n) : E.left(n)
)(numbers);
const evenResult = Array.from(evens); // [2, 4, 6, 8, 10]
const oddResult = Array.from(odds); // [1, 3, 5, 7, 9]