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
More problems with memoization
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-09-30 (19:26)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] More problems with memoization
> Well, the problem is, that the ocaml type inference forbids a function to
> return a polymorphic value, so the type of make_mem' is only ('_a -> '_b)
> -> '_a -> '_b. So the right thing to do here (as this type is, obviously,
> incorrect) is to use Obj.magic:

I'm sorry, the OCaml  type inference is correct to infer the type ('_a ->
'_b) -> '_a -> '_b here, but I believe that there can be no error caused
generalizing it.