From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id QAA19400 for caml-redistribution; Fri, 24 May 1996 16:36:42 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id QAA19006 for ; Fri, 24 May 1996 16:04:22 +0200 Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by concorde.inria.fr (8.7.1/8.7.1) with ESMTP id QAA00352 for ; Fri, 24 May 1996 16:04:20 +0200 (MET DST) Received: from delsarte.loria.fr (delsarte.loria.fr [152.81.6.130]) by lorraine.loria.fr (8.7.5/8.7.3) with ESMTP id QAA19704 for ; Fri, 24 May 1996 16:04:20 +0200 (MET DST) From: Bouzid Djamila Received: (from bouzidd@localhost) by delsarte.loria.fr (8.7.4/8.7.3) id QAA04595 for caml-list@pauillac.inria.fr; Fri, 24 May 1996 16:04:19 +0200 (MET DST) Message-Id: <199605241404.QAA04595@delsarte.loria.fr> Subject: csl-> pb avec les fonctions dans le module To: caml-list@pauillac.inria.fr Date: Fri, 24 May 1996 16:04:18 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: weis Bonjour, Voila mon probleme : quand je rentre dans l'interpreteur Caml Special Light la fonction let do_if_debug x = if x then (function (f, a) -> (f a)) else (function (f,a)-> ());; la reponse est val do_if_debug : bool -> ('a -> unit) * 'a -> unit = mais si j'introduis la meme fonction dans un functor c-a-d si je rentre par exemple module type S1 = sig val x : bool end module F (X: S1) = struct let do_if_debug = if X.x then (function (f, a) -> (f a)) else (function (f,a)-> ()) end;; il m'affiche le message d'erreur suivant The type of this expression, ('_a -> unit) * '_a -> unit, contains type variables that cannot be generalized A quoi cela est du ?? Merci pour la reponse. -------------------------------------------------------------------- Hi! My problem is : if I write in Caml Special Light interpreter this function let do_if_debug x = if x then (function (f, a) -> (f a)) else (function (f,a)-> ());; the response of the interpreter is val do_if_debug : bool -> ('a -> unit) * 'a -> unit = but if I introduce the same function in functor i.e if I write for example module type S1 = sig val x : bool end module F (X: S1) = struct let do_if_debug = if X.x then (function (f, a) -> (f a)) else (function (f,a)-> ()) end;; then the response is The type of this expression, ('_a -> unit) * '_a -> unit, contains type variables that cannot be generalized what is the problem ?? Thanks for the response. D. Bouzid