Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Created October 4, 2019 17:56
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 Pitometsu/28dce49cc40a2bd98d15053ceb7f3e5b to your computer and use it in GitHub Desktop.
Save Pitometsu/28dce49cc40a2bd98d15053ceb7f3e5b to your computer and use it in GitHub Desktop.
module type M = sig
module type S
module S : S
end
;; module type M = sig module type S module S : S end
module type F = functor (M : M) -> M.S
;; module type F = functor (M : M) -> M.S
module type FF = functor (F : F) -> functor (M : M) -> M.S
;; module type FF = functor (F : F) (M : M) -> M.S
module FF (F : F) (M : M) : M.S = F (M)
;; module FF : functor (F : F) (M : M) -> M.S
module F (M : M) = FF (functor (S : module type of M) -> S.S) (M)
;; module F : functor (M : M) -> M.S
module A = F (struct module type S = sig type a end module rec S : S = S end)
;; module A : sig type a end
module B = F (struct module type S = sig type b end module rec S : S = S end)
;; module B : sig type b end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment