Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Type error
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-02 (01:28)
From: Jon Harrop <jon@f...>
Subject: Type error

I've got a type error:

This type of expression, <height:int; width:int; _..> -> unit, contains type 
variables that cannot be generalized

which appears with the form:

let f =
  let t = ref None in
  fun data -> ...

but not in the unnested form:

let t = ref None

let f =
  fun data -> ...

Is that supposed to happen? I thought those two forms were exactly equivalent 
(except for polluting the outer namespace in the latter case).

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists