Skip to main content
Module

x/ahh/mod.ts>R.map

Idiomatic type-safety structures for TypeScript.
Go to Latest
method R.map
import { R } from "https://deno.land/x/ahh@v0.10.0/mod.ts";

Calls f with res, and returns the result.

Examples

import { R } from "./mod.ts";

console.log(R.map(1, (i) => i + 1)); // 2
console.log(R.map(Error(), (i: number) => i + 1)); // Error()

Type Parameters

T
U
E extends Error

Parameters

res: Result<T, E>
f: (_: T) => U