Skip to content

Instantly share code, notes, and snippets.

@haochenx
Created April 6, 2021 13:27
Show Gist options
  • Save haochenx/fd4b02deeed88b0d573e6bb8b0eac01b to your computer and use it in GitHub Desktop.
Save haochenx/fd4b02deeed88b0d573e6bb8b0eac01b to your computer and use it in GitHub Desktop.
module type Greeting = sig
type t
val hello : string
end
(* Hi guys, why this does not type check *)
module type MakeGreeting =
(functor (M1 : Greeting)
(M2 : Greeting with type t = M1.t) ->
sig
type t = M1.t
val hello : string
end with type M1.t = M2.t)
(* while this does? *)
module type MakeGreeting =
(functor (M1 : Greeting)
(M2 : Greeting with type t = M1.t) ->
sig
type t = M1.t
val hello : string
end with type t = M2.t)
(* assuming OCaml 4.12 *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment