Is there conditional access operator in F# (similar to new ?. in C#)?

后端 未结 3 1415
傲寒
傲寒 2021-01-18 17:14

Now that the C# 6 is finally going to have this long-anticipated ?. operator, is there similar thing in F#? And I\'m not talking about ? operator.

3条回答
  •  生来不讨喜
    2021-01-18 17:38

    In functional languages, conditional / compositional traversal, especial in nested structures is generally modelled using the notion of lenses which is explained with a succinct example in this SO thread.

    In the F# environment, there's Aether; see intro article and guide, which builds on the Lenses support developed and written about by Mauricio Scheffer in FSharpx here.

提交回复
热议问题