Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Jon Harrop
    ... Textures is a set of types in this case. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists
    Message 1 of 4 , Dec 31, 2006
    • 0 Attachment
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.