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

traverse

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

Traverse over a These using the supplied Applicable.

@example
import { traverse, right, both } from "./these.ts";
import * as O from "./option.ts";
import { pipe } from "./fn.ts";

const traversed = pipe(
  right(5),
  traverse(O.ApplicableOption)(n => O.some(n * 2))
);

console.log(traversed); // Some({ tag: "Right", right: 10 })
function traverse<U extends Kind>(A: Applicable<U>): <A, I, J, K, L, M>(favi: (a: A) => $<U, [I, J, K], [L], [M]>) => <B>(ta: These<B, A>) => $<U, [These<B, I>, J, K], [L], [M]>;
§
traverse<U extends Kind>(A: Applicable<U>): <A, I, J, K, L, M>(favi: (a: A) => $<U, [I, J, K], [L], [M]>) => <B>(ta: These<B, A>) => $<U, [These<B, I>, J, K], [L], [M]>
[src]

§Type Parameters

§
U extends Kind
[src]

§Parameters

§Return Type

§
<A, I, J, K, L, M>(favi: (a: A) => $<U, [I, J, K], [L], [M]>) => <B>(ta: These<B, A>) => $<U, [These<B, I>, J, K], [L], [M]>
[src]