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
[Caml-list] Sample code doesn't work
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Rolf Wester <wester@i...>
Subject: [Caml-list] Sample code doesn't work

I have a problem with the following simple example:

let rec make_account wert0 = 
  let wert = wert0 in
  let add wert_ =
    make_account (wert+.wert_)
  let sub wert_ =
    make_account (wert-.wert_)
  let get () = 
  (add, sub, get);;

When trying to evaluate this I get the error message:

This expression has type
  (float -> 'a * 'b * 'c) * (float -> 'a * 'b * 'c) * (unit -> float)
but is here used with type 'a * 'b * 'c

How can I make this work?

Rolf Wester
Rolf Wester
Bug reports:  FAQ:
To unsubscribe, mail  Archives: