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

createBindTo

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

Create a bindTo function from a structure with an instance of Mappable. A bindTo function takes the inner value of the structure and maps it to the value of a struct with the given name. It is useful for lifting the value such that it can then be used with a bind function, effectively allowing for Do-like notation in typescript.

function createBindTo<U extends Kind>({ map }: Mappable<U>): <N extends string>(name: N) => <A, B = never, C = never, D = unknown, E = unknown>(ua: $<U, [A, B, C], [D], [E]>) => $<U, [readonly [K in N]: A, B, C], [D], [E]>;
§
createBindTo<U extends Kind>({ map }: Mappable<U>): <N extends string>(name: N) => <A, B = never, C = never, D = unknown, E = unknown>(ua: $<U, [A, B, C], [D], [E]>) => $<U, [readonly [K in N]: A, B, C], [D], [E]>
[src]

§Type Parameters

§
U extends Kind
[src]

§Parameters

§
{ map }: Mappable<U>
[src]

§Return Type

§
<N extends string>(name: N) => <A, B = never, C = never, D = unknown, E = unknown>(ua: $<U, [A, B, C], [D], [E]>) => $<U, [readonly [K in N]: A, B, C], [D], [E]>
[src]