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

compose

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

Compose two functions by taking the output of one and passing it to another. This is equivalent to the map function.

@example
import { compose, pipe } from "./fn.ts";

const length = (s: string) => s.length;
const dup = (n: number) => n + n;

const composed = pipe(
  length,
  compose(dup),
);

const result1 = composed("Hello"); // 10
const result2 = composed(""); // 0
function compose<A, I>(second: Fn<A, I>): <D>(first: Fn<D, A>) => Fn<D, I>;
§
compose<A, I>(second: Fn<A, I>): <D>(first: Fn<D, A>) => Fn<D, I>
[src]

§Type Parameters

§Parameters

§
second: Fn<A, I>
[src]

§Return Type

§
<D>(first: Fn<D, A>) => Fn<D, I>
[src]