Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* csl-> pb avec les fonctions dans le module
@ 1996-05-24 14:04 Bouzid Djamila
  0 siblings, 0 replies; only message in thread
From: Bouzid Djamila @ 1996-05-24 14:04 UTC (permalink / raw)
  To: caml-list


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 = <fun>

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 = <fun>

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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-05-24 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-24 14:04 csl-> pb avec les fonctions dans le module Bouzid Djamila

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox