RunKit + npm: partial.lenses

node v8.17.0
endpointsharetweet
const Future = require("fluture") const L = require("partial.lenses") const structure = { foo: 'bar', foobar: { foo: 2, bar: 4 } } const optic = ['foobar', L.values] const fromFantasy = of => ({ of, map: (f, x) => x['fantasy-land/map'](f), ap: (f, x) => x['fantasy-land/ap'](f), chain: (f, x) => x['fantasy-land/chain'](f) }) L.traverse( fromFantasy(Future.of), x => Future.of(x + 1), optic, structure ).fork( err => console.log('Error', err), res => console.log('Result', res) )
Created from: https://npm.runkit.com/partial.lenses
Loading…