Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

partitionMap

import { partitionMap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/datum.ts";

Partition and map a Datum using an Either.

@example
import { partitionMap, replete, initial } from "./datum.ts";
import * as E from "./either.ts";

const classify = (n: number) => n % 2 === 0 ? E.right(n) : E.left(n);
const [evens, odds] = partitionMap(classify)(replete(4));
console.log(evens); // Replete(4)
console.log(odds); // Initial
function partitionMap<A, I, J>(fai: (a: A) => Either<J, I>): (ua: Datum<A>) => Pair<Datum<I>, Datum<J>>;
§
partitionMap<A, I, J>(fai: (a: A) => Either<J, I>): (ua: Datum<A>) => Pair<Datum<I>, Datum<J>>
[src]

§Type Parameters

§Parameters

§
fai: (a: A) => Either<J, I>
[src]

§Return Type

§
(ua: Datum<A>) => Pair<Datum<I>, Datum<J>>
[src]