| Newsgroups |
gmane.comp.lang.ocaml.beginners |
| Message-ID |
<CAMu2m2J+otHRcGAtJtPxCCXbez9NnxYct2mRMqq6C1yrRsg2yg@mail.gmail.com> |
It seems you defined the Record, List, etc. modules yourself and all of
your types don't take type parameters. When you open Core.Std, it has a
module called List, so now in "type list = List.t" the "List" refers to
Core.Std.List, i.e. you shadowed whatever other List module you're trying
to use. Core's List.t does require a parameter, so your type definition is
no longer valid.
On Wed, Jun 24, 2015 at 2:13 PM, Kenneth Miller [email protected]
[ocaml_beginners] <[email protected]> wrote:
>
>
> 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" ??
>
>
>
>