From bbc51a0df9d57191e7bf91e398ce159cb8409589 Mon Sep 17 00:00:00 2001 From: kutyel Date: Thu, 14 Dec 2017 11:27:13 +0100 Subject: [PATCH] =?UTF-8?q?CURRY=20ALL=20THE=20THINGS!=20=F0=9F=8D=9B?= =?UTF-8?q?=F0=9F=8D=9B=F0=9F=8D=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index 93f9281..5f254cf 100644 --- a/main.js +++ b/main.js @@ -9,7 +9,7 @@ export const chain = curry((f, m) => m.map(f).join()) export const concat = curry((x, y) => x.concat(y)) -export const filter = f => xs => xs.filter(f) +export const filter = curry((f, xs) => xs.filter(f)) export const flip = f => curry((x, y, ...args) => f(y, x, ...args)) @@ -17,21 +17,21 @@ export const head = xs => xs[0] export const identity = x => x -export const join = char => x => x.join(char) +export const join = curry((char, x) => x.join(char)) export const last = xs => xs[xs.length - 1] -export const map = f => xs => xs.map(f) +export const map = curry((f, xs) => xs.map(f)) -export const prop = prop => obj => obj[prop] +export const prop = curry((prop, obj) => obj[prop]) export const reduce = curry((reducer, init, xs) => xs.reduce(reducer, init)) -export const replace = (regex, char) => str => str.replace(regex, char) +export const replace = curry((regex, char, str) => str.replace(regex, char)) -export const sortBy = f => xs => xs.sort((x, y) => f(x) > f(y)) +export const sortBy = curry((f, xs) => xs.sort((x, y) => f(x) > f(y))) -export const split = char => x => x.split(char) +export const split = curry((char, x) => x.split(char)) export const toLower = str => str.toLowerCase()