From: Eric Hassold <Eric.Hassold@sophia.inria.fr>
To: Hubert Canon <canon@poly.polytechnique.fr>
Cc: caml-list@margaux.inria.fr
Subject: Re: Fonction polymorphe
Date: Thu, 01 Feb 1996 15:03:48 +0100 [thread overview]
Message-ID: <199602011403.PAA04962@medee.inria.fr> (raw)
In-Reply-To: Your message of "Wed, 24 Jan 1996 19:47:22 +0100." <199601241847.TAA02621@poly.polytechnique.fr>
> Un bug probable de caml-light
Sauf erreur de ma part, ce n'est pas un bug, mais une fonctionnalite
introduite dans CL 0.7, qui permet l'affectation dynamique d'un type lors
de la 1ere evaluation ( pour les types representes par '_a au lieu de 'a).
Pour conserver le typage polymorphe, il suffit d'ecrire explicitement
les parametres de la fonction, c-a-d :
let permutations l =
let rec permut fixe = fun
[] [] -> [fixe] |
debut [] -> [] |
debut (x :: suite) -> (permut (fixe @ [x]) []
(debut @ suite)) @
(permut fixe (debut @ [x]) suite)
in
permut [] [] l;;
- : permutations : '_a list -> '_a list list = <fun>
et tout marche.
prev parent reply other threads:[~1996-02-01 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-01-24 18:47 Hubert Canon
1996-02-01 14:03 ` Pierre Weis
1996-02-01 14:03 ` Eric Hassold [this message]
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=199602011403.PAA04962@medee.inria.fr \
--to=eric.hassold@sophia.inria.fr \
--cc=caml-list@margaux.inria.fr \
--cc=canon@poly.polytechnique.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