Skip to main content
Module

x/hkts/option.ts>mapNullable

Functional programming tools: option, either, task, state, optics, etc.
Latest
variable mapNullable
import { mapNullable } from "https://deno.land/x/hkts@v0.0.52/option.ts";

mapNullable is useful for piping an option's values through functions that may return null or undefined.

Examples

const a = pipe( some([1, 2, 3]), mapNullable(numbers => numbers[3]) ); // None (Option)

type

<A, B>(f: (a: A) => B | null | undefined) => unknown