Skip to content

Instantly share code, notes, and snippets.

@dinosaure
Created January 12, 2018 17:58
Show Gist options
  • Save dinosaure/d6ed452805c30f6eede78517a3a7dcc7 to your computer and use it in GitHub Desktop.
Save dinosaure/d6ed452805c30f6eede78517a3a7dcc7 to your computer and use it in GitHub Desktop.
module type SA =
sig
type v
type t = { value: v }
end
module type SB =
sig
type v
module A: SA with type v = v
type t =
| A of A.t
| B
end
module A (S: sig type v end): SA with type v = S.v =
struct
type v = S.v
type t = { value: v }
end
module B (S: sig type v end): SB with type v = S.v =
struct
type v = S.v
module A: SA with type v = v = A(S)
type t =
| A of A.t
| B
end
module type SC =
sig
module S: sig type v end
module B: SB with type v = S.v
and module A = A(S)
end
module C (S: sig type v end): SC with module S = S and module B = B(S) =
struct
module B = B(S)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment