TL;DR: given a functional-reference/optics library, should you be able to say "set the endpoint of this path to X, creating empty elements along the way as necessary"?
Scala and Elm have a lens implementation libraries (Scala, Elm). They add an Optional
to the canonical Lens/Prism/Iso types. It's useful for dictionaries/maps/hashes. I think it corresponds roughly to Haskell/Lens's Lens.At. I have a question about the behavior of Elm's version that seems Not What You'd Want, but can't interpret the Haskell or Scala versions well enough to determine an answer from them.
The issue is composing two Optional
values together. Suppose we have two Optional
s that focus on particular keys in a dictionary:
top
is an Optional tha