Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const combinators = require('fantasy-combinators');
const curry = require('fantasy-helpers').curry
//# bluebird :: (b -> c) -> (a -> b) -> a -> c
//.
//. B combinator or function composition
//.
//. ```js
//. > bluebird(x => x * 2)(x => x - 1)(3)
//. 4
//. ```
const bluebird = curry(combinators.compose)
module.exports = bluebird
const curry = require('fantasy-helpers').curry
//# cardinal_ :: (c -> a -> d) -> (b -> c) -> a -> b -> d
//.
//. C' combinator
//.
//. ```js
//. > cardinal_(x => y => x * y)(x => x + 1)(2)(3)
//. 8
//. ```
const cardinal_ = curry((f, g, x, y) => f(g(y))(x))
module.exports = cardinal_
const curry = require('fantasy-helpers').curry
//# becard :: (c -> d) -> (b -> c) -> (a -> b) -> a -> d
//.
//. B3 combinator or function composition (for three functions)
//.
//. ```js
//. > becard(x => x * -1)(x => x * 2)(x => x - 1)(3)
//. -4
//. ```
const becard = curry((f, g, h, x) => f(g(h(x))))
module.exports = becard
const curry = require('fantasy-helpers').curry
//# robinstarstar :: (a -> c -> d -> b -> e) -> a -> b -> c -> d -> e
//.
const robinstarstar = curry((f, s, t, u, v) => f(s)(u)(v)(t))
module.exports = robinstarstar
const curry = require('fantasy-helpers').curry
//# idstarstar :: (a -> b -> c) -> a -> b -> c
//.
const idstarstar = curry((f, x, y) => f(x)(y))
module.exports = idstarstar
'use strict';
const { constant } = require('fantasy-combinators');
const { curry } = require('fantasy-helpers');
const over = curry((l, f, s) => l(f)(s));
const set = curry((l, b, s) => over(l, constant(b), s));
const map = curry((f, x) => x.map(f));
module.exports = { over
, set: set
, map
};
'use strict';
const { constant } = require('fantasy-combinators');
const { curry } = require('fantasy-helpers');
const over = curry((l, f, s) => l(f)(s));
const set = curry((l, b, s) => over(l, constant(b), s));
const map = curry((f, x) => x.map(f));
module.exports = { over
, set: set
, map
};
'use strict';
const { constant } = require('fantasy-combinators');
const { curry } = require('fantasy-helpers');
const over = curry((l, f, s) => l(f)(s));
const set = curry((l, b, s) => over(l, constant(b), s));
const map = curry((f, x) => x.map(f));
module.exports = { over
, set: set
, map
};
const combinators = require('fantasy-combinators');
const curry = require('fantasy-helpers').curry
//# thrush :: a -> (a -> b) -> b
//.
const thrush = curry(combinators.thrush)
module.exports = thrush
const curry = require('fantasy-helpers').curry
//# eagle :: (a -> d -> e) -> a -> (b -> c -> d) -> b -> c -> e
//.
//. E combinator
//.
//. ```js
//. > eagle(prefix => str => prefix + str)('-')(str => postfix => str + postfix)('birds')('!')
//. '-birds!'
//. ```
const eagle = curry((f, x, g, y, z) => f(x)(g(y)(z)))
module.exports = eagle