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

Unions between polymorphic variants behind module types

$
0
0

You can do this:

module type T = {
  type t
}

module A: T with type t = [#a] = {
  type t = [ #a]
}

module B: T with type t = [#b] = {
  type t = [ #b]
}

module C = {
  type t = [A.t | B.t]
  let a: t = #b
}

If you can come up with another solution in OCaml we can try to convert it together to rescript.


Viewing all articles
Browse latest Browse all 2592

Trending Articles