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

createBind

import { createBind } from "https://raw.githubusercontent.com/baetheus/fun/main/flatmappable.ts";

Create a bind function for a structure with instances of Mappable and Flatmappable. A bind function allows one to flatmap into named fields in a struct, collecting values from the result of the flatmap in the order that they are completed.

function createBind<U extends Kind>({ flatmap, map }: Flatmappable<U>): <N extends string, A, I, J = never, K = never, L = unknown, M = unknown>(name: Exclude<N, keyof A>, faui: (a: A) => $<U, [I, J, K], [L], [M]>) => <B = never, C = never, D extends L = L>(ua: $<U, [A, B, C], [D], [M]>) => $<U, [readonly [K in keyof A | N]: K extends keyof A ? A[K] : I, B | J, C | K], [D & L], [M]>;
§
createBind<U extends Kind>({ flatmap, map }: Flatmappable<U>): <N extends string, A, I, J = never, K = never, L = unknown, M = unknown>(name: Exclude<N, keyof A>, faui: (a: A) => $<U, [I, J, K], [L], [M]>) => <B = never, C = never, D extends L = L>(ua: $<U, [A, B, C], [D], [M]>) => $<U, [readonly [K in keyof A | N]: K extends keyof A ? A[K] : I, B | J, C | K], [D & L], [M]>
[src]

§Type Parameters

§
U extends Kind
[src]

§Parameters

§
{ flatmap, map }: Flatmappable<U>
[src]

§Return Type

§
<N extends string, A, I, J = never, K = never, L = unknown, M = unknown>(name: Exclude<N, keyof A>, faui: (a: A) => $<U, [I, J, K], [L], [M]>) => <B = never, C = never, D extends L = L>(ua: $<U, [A, B, C], [D], [M]>) => $<U, [readonly [K in keyof A | N]: K extends keyof A ? A[K] : I, B | J, C | K], [D & L], [M]>
[src]