Just saw as JS lib `partial.lenses` highly inspired by Haskell in a Stack Overflow question. Cool, I like that you see the benefit of FP, but please DON'T go down this route. That code is SO difficult to read and understand. IF you want optics & guarantees, I implore you to stop trying to make JS like Haskell and either use GHCJS or PureScript (or Elm) and be done with it. It's very hard for people to grok & you bring little safety outside of the lib being pure functions. Get it first-class, not bolted on.