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

sequence

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

Sequence over an ReadonlyRecord of type V, inverting the relationship between V and ReadonlyRecord. This function also keeps the indexed types of in each V at covariant position 0. In other words sequence over [Option, Option] becomes Option<[number, string]>.

@example
import * as R from "./record.ts";
import * as O from "./option.ts";

const sequence = R.sequence(O.ApplicableOption);

const result1 = sequence({ one: O.some(1), two: O.some("Hello")}); // Some({ one: 1, two: "Hello"})
const result2 = sequence({ one: O.none, two: O.some("Uh Oh")}); // None
function sequence<V extends Kind>(A: Applicable<V>): <VS extends ReadonlyRecord<AnySub<V>>>(values: NonEmptyRecord<VS>) => Sequence<V, VS>;
§
sequence<V extends Kind>(A: Applicable<V>): <VS extends ReadonlyRecord<AnySub<V>>>(values: NonEmptyRecord<VS>) => Sequence<V, VS>
[src]

§Type Parameters

§
V extends Kind
[src]

§Parameters

§Return Type

§
<VS extends ReadonlyRecord<AnySub<V>>>(values: NonEmptyRecord<VS>) => Sequence<V, VS>
[src]