Equivalent of Scala “case class” in F#

前端 未结 2 1876
猫巷女王i
猫巷女王i 2021-02-04 01:57

I am looking for the equivalent in F# of \"case classes\" that are available in Scala.

Cases classes are very useful when you want to create custom classes with methods

2条回答
  •  死守一世寂寞
    2021-02-04 02:11

    Discriminated unions? You can add member methods to them. Alternatively you can use active patterns on an existing class.

提交回复
热议问题