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()