Skip to main content
Module

x/fun/flatmappable.ts>createBind

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

Returns

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