Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: partial.lenses
node v8.17.0
endpoint
share
tweet
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…
Clone and edit this document