Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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?