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
[Caml-list] Polymorphic variant abbreviations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-19 (08:57)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Polymorphic variant abbreviations
Patrick M Doane <patrick@watson.org> writes:

> (* The first works as I would expect, the second gives a very unexpected
> type. There seems to be some kind of unexpected unification going on
> between terms. *)
> let h1 (#b as x1) (#c as x2) = `A [x1; x2]
> let h2 (x1 : #b) (x2 : #c) = `A [x1; x2]

there is unification, a list can only contain item of same type.
Rémi Vanicat
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr