Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

map

import { map } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";

Apply a function to each element of an Iterable.

@example
import * as I from "./iterable.ts";

const numbers = I.wrap(1, 2, 3, 4, 5);
const doubled = I.map((n: number) => n * 2)(numbers);

const result = Array.from(doubled); // [2, 4, 6, 8, 10]
function map<A, I>(fai: (a: A) => I): (ta: Iterable<A>) => Iterable<I>;
§
map<A, I>(fai: (a: A) => I): (ta: Iterable<A>) => Iterable<I>
[src]

§Type Parameters

§Parameters

§
fai: (a: A) => I
[src]

§Return Type

§
(ta: Iterable<A>) => Iterable<I>
[src]