Hacker News new | ask | show | jobs
by tthisk 2384 days ago
Lenses are type-safe, so if you care about type-safety then object/json paths are not really a feasible option. Regarding the boilerplate in this post, that is mainly a side-effect of demonstrating how lenses work. If you use a library like monocle-ts the boilerplate is reduced drastically (see: https://github.com/gcanti/monocle-ts).
1 comments

Aaah I see, I had completely glossed over the type-safety aspect which makes the difference. Thanks, and thanks for the reference to monocle-ts.