--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, Martin Jambon
<martin_jambon
...> wrote:
>
> On Tue, 4 Mar 2008, knighttemplar0184 wrote:
>
> > I'm trying to write a type that can hold a function like ('a
Map.Make
> > (String).t -> int list -> int) but when I do this I get the
> > error "Unbound type parameter 'a". What's the best way to solve
this?
> >
> > The actual code is:
> >
> > type expr = Fn of ('a Map.Make(String).t -> int list -> int);;
>
> type 'a expr = ...
>
> If you have several parameters, use parens and commas:
>
> type ('a, 'b, 'foo, 'bar) expr = ...
>
>
>
> Martin
>
> --
> http://wink.com/profile/mjambon
> http://martin.jambon.free.fr
>
How about in a recursive type like "type 'a expr = Num of int | Fn of
(('a Map.Make(String).t) -> expr list -> expr);;"? This gives an
error because the second expr list and expr don't need the 'a but
expect it anyways.
.