Re: "ocaml_beginners":: The type of this expression... contains type variables that cannot be generalized
- On Sunday 31 December 2006 20:38, Grant Olson wrote:
> > You are trying to store heterogeneously typed values in a language that"Textures" is a set of types in this case.
> > only supports homogeneous types. There are various ways around this.
> > The simplest is to support only one type and add a type annotation:
> > let textures : (string, ([ `rgb ], [ `ubyte ]) GlPix.t) Hashtbl.t =
> > Hashtbl.create 100;;
> Thanks, that worked. But just to clarify, is it heterogeneous because the
> value types normally need to match the key types? I thought it was
> homogeneous because all of the keys were strings, and all of the values
> were textures.
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists