在 F# 中,我想基于现有实例构造一个可区分联合的实例(正确的术语?)。例子:
type union Currency =
| Dollar of int
| Euro of int
let lowPrice = Dollar 100 (* or, it could be *) let lowPrice = Euro 100
let highPrice = (* of the same union case as lowPrice but with value 200 *)
我可以插入什么代码来代替注释来创建这种效果?