-
-
Save Pitometsu/6a346dd626f6eb62576d16b4b06e7507 to your computer and use it in GitHub Desktop.
first-class modules type limitation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utop # let (module M) = (module Caml.Map.Make(Int64) : Caml.Map.S) in let to_ : unit -> _ M.t = fun () -> failwith "und" in to_;; | |
Error: This expression has type unit -> 'a M.t | |
but an expression was expected of type 'b | |
The type constructor M.t would escape its scope | |
utop # let module M = Caml.Map.Make(Int64) in let to_ : unit -> _ M.t = fun () -> failwith "und" in to_;; | |
- : unit -> 'a Map.Make(Core_kernel__Int64).t = <fun> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment