From: Bouzid Djamila <Bouzid.Djamila@loria.fr>
To: caml-list@pauillac.inria.fr
Subject: csl-> pb avec les fonctions dans le module
Date: Fri, 24 May 1996 16:04:18 +0200 (MET DST) [thread overview]
Message-ID: <199605241404.QAA04595@delsarte.loria.fr> (raw)
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
reply other threads:[~1996-05-24 14:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199605241404.QAA04595@delsarte.loria.fr \
--to=bouzid.djamila@loria.fr \
--cc=caml-list@pauillac.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox