List Info

Thread: "ocaml_beginners"::[] The type of this expression... contains type variables that cannot be generali




"ocaml_beginners"::[] The type of this expression... contains type variables that cannot be generali
user name
2006-12-31 23:00:18

On Sunday 31 December 2006 20:38, Grant Olson wrote:
> > You are trying to store heterogeneously typed values in a language that
> > 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.

"Textures"; is a set of types in this case.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )