import { O } from "https://deno.land/x/ahh@v0.10.0/src/option/mod.ts";
Calls f
with opt
, and returns the result.
Examples
import { O, None } from "./mod.ts";
console.log(O.map(1, (i) => i + 1)); // 2
console.log(O.map(None, (i: number) => i + 1)); // undefined