Skip to main content
Module

x/ramda/mod.ts>compose

:ram: Practical functional Javascript
Latest
function compose
import { compose } from "https://deno.land/x/ramda@v0.27.2/mod.ts";

Performs right-to-left function composition. The last argument may have any arity; the remaining arguments must be unary.

Note: The result of compose is not automatically curried.

Examples

const classyGreeting = (firstName, lastName) => "The name's " + lastName + ", " + firstName + " " + lastName const yellGreeting = R.compose(R.toUpper, classyGreeting); yellGreeting('James', 'Bond'); //=> "THE NAME'S BOND, JAMES BOND"

R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7