|
|
|
|
|
by T-R
408 days ago
|
|
I definitely agree for traversals, but Lenses need some sort of primitive support - even in Haskell they're mostly generated with TemplateHaskell, and the language developers have spent a long time trying to make the `record.field` accessor syntax overloadable enough to work with lenses[1][2]. Hopefully someday we'll be free from having to memorize all the lens operators. Optics are famously abstract in implementation, but I don't think people have trouble applying them - people seem to like JQuery/CSS selectors, and insist on `object.field` syntax; it's kind of wild that no mainstream language has a first-class way to pass around the description of a location in an arbitrary data structure. [1] https://ghc-proposals.readthedocs.io/en/latest/proposals/002... [2] https://ghc-proposals.readthedocs.io/en/latest/proposals/015... |
|
[1] https://en.cppreference.com/w/cpp/types/offsetof