문제

Is it possible to have mutual recursive types ([<Struct>]) spread across different files? The types are directly under a namespace.

My solution is to put them in one big file and use type ... and ... and ... etc construction. Is it the only way?

도움이 되었습니까?

해결책

You can use a technique called untying the recursive knot where you parameterize one over the other.

So this:

type a = B of b
and b = A of a

becomes:

type 'b a = B of 'b
type b = A of b a
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top