In f# you can use a single case discriminated union to get that behaviour fairly cheaply, and ergonomically.
https://fsharpforfunandprofit.com/posts/designing-with-types...
https://fsharpforfunandprofit.com/posts/designing-with-types...
No comments yet.