| Newsgroups |
gmane.comp.lang.ocaml.beginners |
| Message-ID |
<[email protected]> |
So, I have a library that I'm trying to upgrade to use Core because it has tail recursive definitions that I really need.
In any case, in the library that I'm editing, there's a lot of module declarations that need to be upgraded to specify that their types are from Core in order that the appropriate tail recursive functions be used.
I have the following:
module rec Mymodule: sig type record = Record.t
type variant = Variant.t type enum = Enum.t type alias = Alias.t type list = List.t
And I have to change that to this:
module rec Mymodule: sig open Core.Std type ('a, 'b) record = ('a, 'b) Record.t type ('a, 'b) variant = ('a, 'b) Variant.t type ('a, 'b) enum = ('a, 'b) Enum.t type ('a, 'b) alias = ('a, 'b) Alias.t type 'a list = 'a Core.Std.List.t
The problem is, I want the ('a, 'b) part to be inferred. It was already with the previous definition, but once I open Core.Std, it rejects these saying that some type parameters are needed (more specifically, "The type of this expression contains type variables that cannot be generalized").
Can anybody tell me how to upgrade the existing module type specification to go from, for instance, "type list = List.t" to "type list = Cord.Std.List.t" ??