How to enumerate a discriminated union in F#?

Viewed 5468

How can I enumerate through the possible "values" of a discriminated union in F#?

I want to know if is there something like Enum.GetValues(Type) for discriminated unions, tough I am not sure over what kind of data I would enumerate. I would like to generate a list or array of a discriminated union with one item for each option.

4 Answers
Related