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
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-09-15 (15:20)
From: Wei Hu <weihu@c...>
Subject: Predicativity?

Isn't OCaml's polymorphism predicative? Then, why does the following code in 
the interactive toplevel type check?

# let id x = x;;
val id : 'a -> 'a = <fun>
# let f x = (id id) x;;
val f : 'a -> 'a = <fun>

I thought id could not be applied to itself under predicative polymorphism. Is 
my understanding wrong? Can you show an example that doesn't type check in 
OCaml, but would type check under impredicate polymorphism?