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
Question on polymorphic typing for curried functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-24 (23:32)
From: Harrison, John R <john.r.harrison@i...>
Subject: RE: [Caml-list] Question on polymorphic typing for curried functions
Hi Chris,

| I am looking for a bit of information on the behavior of
| curried functions wrt polymorphic arguments. For instance, in
| the following example, using a curried function seems to lose
| the nice polymorphism that I desire.

OCaml uses a variant of the so-called "value restriction" to ensure
soundness in the way polymorphism and imperative features interact.
You can find more information in this paper by Jacques Garrigue:

It can sometimes be annoying and unintuitive (for me anyway) to lose
polymorphism by eta contraction. But this approach is at least
relatively simple and well-understood.