Browse thread
Unexpected '_a problem
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Andreas Rossberg <AndreasRossberg@w...> |
| Subject: | Re: [Caml-list] Unexpected '_a problem |
Christophe Dehlinger wrote: >On 8/2/06, Remi Vanicat <remi.vanicat@gmail.com > wrote: >>2006/8/1, Andreas Rossberg <AndreasRossberg@web.de>: >> >> This has nothing to do with contravariance, nor with subtyping or objects at >> all. What you observe is the infamous "value restriction": roughly, a >> definition can only be polymorphic when its right-hand side is syntactically >> a value (i.e. a function, tuple, constant, etc or combination thereof). In >> your case it's an application. > >This is Wright's value restriction, that is used in SML (maybe in Alice ML too ?). >OCaml uses Garrigue's relaxed value restriction, which does care about variance >(see http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/morepoly-long.pdf ). >I haven't read that paper recently, but IIRC Garrigue's value restriction allows >generalisation of some of the type parameters that are in covariant position. Oops, right, somehow I had forgotten about the relaxation. Thanks to you and Alain for the correction. - Andreas