English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-07-16 (15:43)
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: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr