Max*_*Max 32 syntax recursion f# types mutual-recursion
我偶然发现了F#中的这个问题.假设,我想声明两种相互引用的类型:
type firstType =
| T1 of secondType
//................
type secondType =
| T1 of firstType
//................
Run Code Online (Sandbox Code Playgroud)
我该怎么做,所以编译器不会生成错误?
Joh*_*bom 52
你使用'和':
type firstType =
| T1 of secondType
and secondType =
| T1 of firstType
Run Code Online (Sandbox Code Playgroud)