You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get"$myObj.$lens.$optional" returns an Option, but get"$myObj.$getter.$optional" returns a List. This is because no "Fold1" exists, and a "Fold" is performed instead. This is surprising behaviour.
We can simulate the expected behaviour by tracking Folds that definitely only have 0-1 elements, and generating a .headOption on the end afterwards.
Something like:
case class Fold(notMulti: Boolean) extends OpticType
get"$myObj.$lens.$optional"
returns an Option, butget"$myObj.$getter.$optional"
returns a List. This is because no "Fold1" exists, and a "Fold" is performed instead. This is surprising behaviour.We can simulate the expected behaviour by tracking Folds that definitely only have 0-1 elements, and generating a
.headOption
on the end afterwards.Something like:
See optics-dev/Monocle#484
The text was updated successfully, but these errors were encountered: