Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将相互递归类型 ( [<Struct>]) 分布在不同的文件中?这些类型直接位于命名空间下。
[<Struct>]
我的解决方案是将它们放在一个大文件中并使用type ... and ... and ... etc构造。这是唯一的方法吗?
type ... and ... and ... etc
您可以使用一种称为解开递归结的技术,在其中将一个参数化为另一个参数。
所以这:
type a = B of b and b = A of a
变成:
type 'b a = B of 'b type b = A of b a