lenses.js
Functional lenses that compose and stuff
;var compose = compose; // setup an easy test fnvar { return x; }; // here's the data structurevar user = name: "Bob" addresses: street: '99 Maple' zip: 94004 type: 'home' street: '2302 Powell' zip: 94001 type: 'work' // make some lensesvar L = ; // compose the lensesvar secondAddressesStreet = // mess with the user // { name: 'Bob', addresses: [ { street: '99 Maple', zip: 94004, type: 'home' }, { street: '2302 POWELL', zip: 94001, type: 'work' } ] } // 'Bob' // {name: "Kelly", addresses: [{street: '99 Maple', zip: 94004, type: 'home'}, {street: '2302 Powell', zip: 94001, type: 'work'}]}
ROADMAP:
- remove dependency on identity and const from pointfree and use fantasy ones
- update the browser file for amd as well
- add traverses and folds
- more combinators
- prisms
- this list is getting long...