-
-
Save Pitometsu/477c8a60a0c1f5e5732977b2656e8aea to your computer and use it in GitHub Desktop.
Pass module's existential type to universal argument
This file contains 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
module type S = sig | |
type t | |
val of_string : string -> t | |
val to_string : t -> string | |
end | |
let deser : 'a. (module S with type t = 'a) -> (_ -> 'a) * _ = fun m -> | |
let module M = (val m) in | |
M.(of_string, to_string) | |
(* Error: | |
* The type of this packed module contains variables: | |
* (module Convert.CONVERTER with type t = 'a0) | |
*) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found the answer: