Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1774

Recursive types in nested modules

$
0
0

Modules can be recursive as well, but then you need to give them explicit module type definitions:

module Foo = {
  module rec A: {
    type t = {b: B.t}
  } = {
    type t = {b: B.t}
  }

  and B: {
    type t = {a: A.t}
  } = {
    type t = {a: A.t}
  }
}

Viewing all articles
Browse latest Browse all 1774

Trending Articles