-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Changes: v0.10.0...v0.11.0
Removals:
- ❌ debug extension remove extensions #857
- ❌ impure extension remove extensions #857
- ❌ lazylist extension remove extensions #857
- ❌
R.opsupport R.__ placeholder in curry functions #819 - ❌
R.pathOnchange path functions to operate on lists of strings #876
Deprecations (to be removed in v0.12.0):
- 💾
R.appendTodeprecate R.appendTo and R.prependTo #868 - 💾
R.installTodeprecate R.installTo #870 - 💾
R.prependTodeprecate R.appendTo and R.prependTo #868 - 💾
R.propOfdeprecate R.propOf #869 - 💾 👽
R.Ideprecate R.I #880 - 💾 👽
R.getdeprecate R.get #871
Changes:
- all Ramda's fixed-arity functions are now curried invariants for partial application #836
- all Ramda's fixed-arity functions now respect the
R.__placeholder in any position(s) support R.__ placeholder in curry functions #819 invariants for partial application #836 - applying a curried function to no arguments no longer throws remove special case for curried function applied to zero arguments #856
R.always()is no longer equivalent toR.always(undefined)invariants for partial application #836⚠️ R.assocPathnow operates on a list of strings change path functions to operate on lists of strings #876R.bindnow preserves arity preserve arity in R.bind #827R.curryandR.curryNnow return a function which respects theR.__placeholder support R.__ placeholder in curry functions #819R.identity()is no longer equivalent toR.identity(undefined)invariants for partial application #836⚠️ R.pathnow operates on a list of strings change path functions to operate on lists of strings #876⚠️ R.pathEqnow operates on a list of strings change path functions to operate on lists of strings #876R.slicenow supports array-like objects support array-like objects in R.slice #840
Additions:
- 🆕
R.dissocPathImplement dissocPath #864 change path functions to operate on lists of strings #876 - 🆕
R.lensOnlensOn for a particular object #855
R.__ placeholder
Prior to v0.11.0 certain functions respected the R.__ placeholder. For example:
var isPositive = R.gt(R.__, 0);
isPositive(0); // => false
isPositive(1); // => trueAll Ramda's fixed-arity functions now respect the R.__ placeholder in any position(s). For example:
var greet = R.replace('{name}', R.__, 'Welcome, {name}. Enjoy your stay.');
greet('Alice'); //=> 'Welcome, Alice. Enjoy your stay.'Given:
var f = function(a, b, c) { return [a, b, c]; };
var g = R.curry(f);
var _ = R.__;the following are equivalent:
g(_, 2, 3)(1)
g(1, _, 3)(2)
g(1, 2, _)(3)
g(1, _, _)(2)(3)
g(_, 2, _)(1)(3)
g(_, _, 3)(1)(2)
g(1, _, _)(2, 3)
g(_, 2, _)(1, 3)
g(_, _, 3)(1, 2)
g(1, _, _)(_, 3)(2)
g(_, 2, _)(_, 3)(1)
g(_, _, 3)(_, 2)(1)
g(_, _, _)(_, _)(_)(1, 2, 3)
g(_, _, _)(1, _, _)(_, _)(2, _)(_)(3)Functions returned by R.curry and R.curryN also respect R.__.
Invariants
Thanks to #819, #836, and #856, the following invariants now hold throughout the library:
- For every curried function
fwheref.length > 0, applyingfto no arguments gives a function equivalent tof. - For every curried function
fwheref.length > 0, applyingftoR.__gives a function equivalent tof. - For every curried function
fwheref.length > 1, applyingfto any value other thanR.__gives a functiongwith lengthf.length - 1. All three invariants hold forgand all "descendants" ofg.
The invariants also hold for functions returned by R.curry and R.curryN.
Reactions are currently unavailable