Skip to content

Instantly share code, notes, and snippets.

@EduardoRFS
Created March 19, 2021 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EduardoRFS/ccf3cf4183a46f0449e411b48db57e34 to your computer and use it in GitHub Desktop.
Save EduardoRFS/ccf3cf4183a46f0449e411b48db57e34 to your computer and use it in GitHub Desktop.
type ('a, 'b) eq = Eq : ('a, 'a) eq
module type X = sig
module type T'
module type T = sig
module T : T'
end
type a
val eq : (a, (module T)) eq
val eq' : (a, (module T')) eq
end
module rec V : X = struct
module type T' = V.T
module type T = sig
module T : V.T'
end
type a = (module T)
let eq = (Eq : (a, (module T)) eq)
let eq' = (Eq : (a, (module T')) eq)
end
let f : (module V.T') -> (module V.T) =
fun packed ->
let a : V.a =
let Eq = V.eq' in
packed
in
let Eq = V.eq in
a
let f' : (module V.T) -> (module V.T') =
fun packed ->
let a : V.a =
let Eq = V.eq in
packed
in
let Eq = V.eq' in
a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment