How to enumerate an enum/type in F#

前端 未结 7 2000
攒了一身酷
攒了一身酷 2021-01-11 09:43

I\'ve got an enumeration type defined like so:

type tags = 
    | ART  = 0
    | N    = 1
    | V    = 2 
    | P    = 3
    | NULL = 4

is

相关标签:
7条回答
  • 2021-01-11 10:20

    Robert's right about how to generate an actual enum and get its cases. If you have a true union type, you can get the cases via the Microsoft.FSharp.Reflection.FSharpType.GetUnionCases function.

    0 讨论(0)
提交回复
热议问题