partial.lenses
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.props = exports.identity = exports.pick = exports.augment = exports.filter = exports.append = exports.index = exports.findWith = exports.find = exports.prop = exports.normalize = exports.define = exports.required = exports.defaults = exports.replace = exports.choice = exports.orElse = exports.nothing = exports.choose = exports.get = exports.set = exports.modify = exports.lens = exports.removeAll = exports.remove = exports.compose = exports.toRamda = exports.fromRamda = undefined; | ||
exports.props = exports.identity = exports.pick = exports.augment = exports.filter = exports.append = exports.index = exports.findWith = exports.find = exports.prop = exports.normalize = exports.define = exports.required = exports.defaults = exports.replace = exports.choice = exports.orElse = exports.nothing = exports.choose = exports.just = exports.chain = exports.get = exports.set = exports.modify = exports.lens = exports.removeAll = exports.remove = exports.compose = exports.toRamda = exports.fromRamda = undefined; | ||
@@ -136,2 +136,12 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var chain = exports.chain = R.curry(function (x2yL, xL) { | ||
return compose(xL, choose(function (xO) { | ||
return xO === undefined ? nothing : x2yL(xO); | ||
})); | ||
}); | ||
var just = exports.just = function just(x) { | ||
return lens(R.always(x), snd); | ||
}; | ||
var choose = exports.choose = function choose(x2yL) { | ||
@@ -306,2 +316,2 @@ return function (toFunctor) { | ||
exports.default = compose; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9wYXJ0aWFsLmxlbnNlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQTs7SUFBWTs7Ozs7Ozs7OztBQUlaLElBQU0sS0FBSyxTQUFMLEVBQUs7U0FBSztDQUFMO0FBQ1gsSUFBTSxNQUFNLFNBQU4sR0FBTSxDQUFDLENBQUQsRUFBSSxDQUFKO1NBQVU7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9PiB7XG4gICAgaWYgKHkgPT09IHVuZGVmaW5lZClcbiAgICAgIHJldHVybiB1bmRlZmluZWRcbiAgICBsZXQgelxuICAgIGNvbnN0IHNldCA9IChrLCB2KSA9PiB7XG4gICAgICBpZiAodW5kZWZpbmVkID09PSB6KVxuICAgICAgICB6ID0ge31cbiAgICAgIHpba10gPSB2XG4gICAgfVxuICAgIGZvciAoY29uc3QgayBpbiB5KSB7XG4gICAgICBpZiAoIShrIGluIHRlbXBsYXRlKSlcbiAgICAgICAgc2V0KGssIHlba10pXG4gICAgICBlbHNlXG4gICAgICAgIGlmIChrIGluIGMpXG4gICAgICAgICAgc2V0KGssIGNba10pXG4gICAgfVxuICAgIHJldHVybiB6XG4gIH0pKVxuXG5leHBvcnQgY29uc3QgcGljayA9IHRlbXBsYXRlID0+IGxlbnMoXG4gIGMgPT4ge1xuICAgIGxldCByXG4gICAgZm9yIChjb25zdCBrIGluIHRlbXBsYXRlKSB7XG4gICAgICBjb25zdCB2ID0gZ2V0KHRlbXBsYXRlW2tdLCBjKVxuICAgICAgaWYgKHYgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAociA9PT0gdW5kZWZpbmVkKVxuICAgICAgICAgIHIgPSB7fVxuICAgICAgICByW2tdID0gdlxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gclxuICB9LFxuICAobyA9IGVtcHR5LCBjSW4pID0+IHtcbiAgICBsZXQgYyA9IGNJblxuICAgIGZvciAoY29uc3QgayBpbiB0ZW1wbGF0ZSlcbiAgICAgIGMgPSBzZXQodGVtcGxhdGVba10sIG9ba10sIGMpXG4gICAgcmV0dXJuIGNcbiAgfSlcblxuZXhwb3J0IGNvbnN0IGlkZW50aXR5ID0gbGVucyhpZCwgY29uc2VydmUpXG5cbmV4cG9ydCBjb25zdCBwcm9wcyA9ICguLi5rcykgPT4gcGljayhSLnppcE9iaihrcywga3MpKVxuXG5leHBvcnQgZGVmYXVsdCBjb21wb3NlXG4iXX0= |
{ | ||
"name": "partial.lenses", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Partial lenses", | ||
@@ -5,0 +5,0 @@ "main": "lib/partial.lenses.js", |
@@ -416,6 +416,6 @@ [ [Tutorial](#tutorial) | [Reference](#reference) | [Background](#background) ] | ||
`L.append` is a special lens that operates on arrays. The view of `L.append` is | ||
always undefined. Setting `L.append` to undefined has no effect by itself. | ||
Setting `L.append` to a defined value appends the value to the end of the | ||
focused array. | ||
`L.append` is a special semi-degenerate lens that operates on arrays. The view | ||
of `L.append` is always undefined. Setting `L.append` to undefined has no | ||
effect by itself. Setting `L.append` to a defined value appends the value to | ||
the end of the focused array. | ||
@@ -444,2 +444,18 @@ For example: | ||
#### [`L.chain(a2bPLens, aPLens)`](#lchaina2bplens-aplens "L.chain :: (a -> PLens s b) -> PLens s a -> PLens s b") | ||
`L.chain(a2bPLens, aPLens)` is equivalent to | ||
```js | ||
L.compose(aPLens, L.choose(aMaybe => | ||
aMaybe === undefined | ||
? L.nothing | ||
: a2bPLens(aMaybe))) | ||
``` | ||
With the `just`, `chain`, `choice` and `nothing` combinators, one can view | ||
partial lenses as subsuming the maybe monad. Of course, the whole point of | ||
lenses is that they are bidirectional and the special lenses `just` and | ||
`nothing` are essentially degenerate. | ||
#### [`L.choose(maybeValue => PLens)`](#lchoosemaybevalue--plens "L.choose :: (Maybe s -> PLens s a) -> PLens s a") | ||
@@ -450,4 +466,3 @@ | ||
lens. In other words, the `L.choose` combinator allows a lens to be constructed | ||
*after* examining the data structure being manipulated. The lens returned by | ||
the function given to `L.choose` will be lifted. | ||
*after* examining the data structure being manipulated. | ||
@@ -475,4 +490,4 @@ For example, given: | ||
`L.choice(...ls)` returns a partial lens that acts like the first of the given | ||
lenses, `...ls`, whose view is not undefined on the given target. When the | ||
views of all of the given lenses are undefined, the returned lens acts like | ||
lenses, `ls`, whose view is not undefined on the given target. When the views | ||
of all of the given lenses are undefined, the returned lens acts like | ||
`L.nothing`, which is the identity element of `L.choice`. | ||
@@ -620,2 +635,15 @@ | ||
#### [`L.just(value)`](#ljustvalue "L.just :: a -> PLens s a") | ||
`L.just(x)` is equivalent to `L.compose(L.nothing, L.defaults(x))` and is a | ||
special degenerate lens whose view is always `x` and writing through the lens | ||
has no effect. In other words, for all `x`, `y` and `z`: | ||
```js | ||
L.get(L.just(z), x) = z | ||
L.set(L.just(z), y, x) = x | ||
``` | ||
`L.just` can be seen as the unit function of the monad formed with `L.chain`. | ||
#### [`L.lens(get, set)`](#llensget-set "L.lens :: (Maybe s -> Maybe a) -> (Maybe a -> Maybe s -> Maybe s) -> PLens s a") | ||
@@ -675,4 +703,4 @@ | ||
`L.nothing` is a special lens whose view is always undefined and setting through | ||
`L.nothing` has no effect. In other words, for all `x` and `y`: | ||
`L.nothing` is a special degenerate lens whose view is always undefined and | ||
setting through `L.nothing` has no effect. In other words, for all `x` and `y`: | ||
@@ -679,0 +707,0 @@ ```js |
@@ -93,2 +93,7 @@ import * as R from "ramda" | ||
export const chain = R.curry((x2yL, xL) => | ||
compose(xL, choose(xO => xO === undefined ? nothing : x2yL(xO)))) | ||
export const just = x => lens(R.always(x), snd) | ||
export const choose = x2yL => toFunctor => target => { | ||
@@ -95,0 +100,0 @@ const l = toRamda(x2yL(target)) |
@@ -154,2 +154,14 @@ import * as R from "ramda" | ||
describe("L.just", () => { | ||
testEq('L.get(L.just("always"), "anything")', "always") | ||
testEq('L.set(L.just("always"), "anything", "original")', "original") | ||
}) | ||
describe("L.chain", () => { | ||
testEq('L.get(L.chain(elems => elems instanceof Array ? 0 : L.identity, "elems"), {elems: ["x"]})', "x") | ||
testEq('L.set(L.chain(elems => elems instanceof Array ? 0 : L.identity, "elems"), "y", {elems: ["x"]})', {elems: ["y"]}) | ||
testEq('L.get(L.chain(elems => elems instanceof Array ? 0 : L.identity, "elems"), {notit: true})', undefined) | ||
testEq('L.set(L.chain(elems => elems instanceof Array ? 0 : L.identity, "elems"), false, {notit: true})', {notit: true}) | ||
}) | ||
describe("L.orElse", () => { | ||
@@ -156,0 +168,0 @@ testEq('L.get(L.orElse("b", "a"), {a: 2, b: 1})', 2) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
892
131749
14
693