Skip to content

Instantly share code, notes, and snippets.

@adrdra
adrdra / Curry&Compose.js
Last active November 18, 2015 19:59
Curry and Compose - Functional programming with Ramda library.
import {compose, curry, map} from 'ramda';
// createPerson :: String -> String -> String
const createPerson = curry((lastname, firstname) => ({firstname, lastname}));
// createDelvaque :: String -> String
const createMalkovich = createPerson('Malkovich');
// setLastnameToUpperCase :: {String} -> {String}
const setLastnameToUpperCase = (obj) => ({firstname: obj.firstname, lastname: obj.lastname.toUpperCase()});