Skip to main content
Module

x/fun/mappable.ts>createBindTo

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function createBindTo
import { createBindTo } from "https://deno.land/x/fun@v2.0.0/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.

Parameters

unnamed 0: Mappable<U>

Returns

<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]>