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
Type from local module would escape its scope?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-07-03 (18:50)
From: Etienne Miret <Etienne.Miret@s...>
Subject: Re: Petty complaint (Was Re: [Caml-list] Type from local module would escape its )scope?

Le 3 juil. 06 à 19:30, brogoff a écrit :

> On Mon, 3 Jul 2006, Virgile Prevosto wrote:
>> IIRC arguments can not have a generalized type of the form
>> "forall 'a, 'a -> unit", but methods and record fields support such
>> types: for instance, you can have:
> It makes me wonder, if OCaml is to be a functional language, why
> functions are second class citizens of the language with regards
> to typing? By various encodings you can get this higher rank
> polymorphism, it's been there for years, but we can't write the  
> function
> directly. Is it because we'd have to write it's type?
> -- Brian

It is because you would be using another type system, called "system F",
wich is much stronger, but infortunately not decidable.

Still, D. Le Botlan and D. Rémy have made a Caml extension
that allow this, but you need to add explicit anotations, as you
have guessed. See http://cristal.inria.fr/~lebotlan/mlf/mlf.html