Last active
August 29, 2015 13:56
-
-
Save zipcode/8855953 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.lenses = function () { | |
var lens = null; | |
for (arg in arguments) { | |
var next = Object.lens(arguments[arg]); | |
lens = lens ? lens.compose(next) : next; | |
} | |
return lens | |
} | |
var l = Object.lenses("one", "five") | |
l({one: {five: 9}}) // 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment