Apologies for cross-postings. Please send it to interested
colleagues and students. Thanks!
CALL FOR PAPERS
World Congress on Internet Security (WorldCIS-2012)
Technically Co-Sponsored by IEEE UK/RI Computer Chapter and IEEE K/W Section
Jun
For a description of how the value restriction is relaxed in the OCaml
type system, see the article
"Relaxing the value restriction", by Jacques Garrigue, 2004
http://caml.inria.fr/about/papers.en.html
On Tue, Jan 10, 2012 at 6:20 PM, David Allsopp wrote:
> Dario Teixeira wrote:
>> Thank you,
***
* *
*SFM-12:MDE *
* *
* 12th International School on *
Dario Teixeira wrote:
> Thank you, Romain and Arnaud. With that "list ref" example in mind, it
> does make sense for the compiler to play it safe and declare foobar2 to
> be non-polymorphic. Moreover, this is one of those issues where I I
> suspect that compiler elfs must have pondered already ho
Hi,
Thank you, Romain and Arnaud. With that "list ref" example in mind,
it does make sense for the compiler to play it safe and declare foobar2
to be non-polymorphic. Moreover, this is one of those issues where I
I suspect that compiler elfs must have pondered already how easy/feasible
it would
**
FINAL CALL FOR PAPERS:
TURING CENTENARY CONFERENCE
http://www.cie2012.eu
Computability in Europe 2012: How the World Computes
University of Cambridge
I guess a canonical example of the reason behind this restriction would be
the following:
let put = let r = ref [] in fun x -> r := x::!r
OCaml will tell you that it has type '_a -> unit. It would be unsound
(exercise!) to decide it has type 'a -> unit.
Of course, your example is perfectly sound
Le 10/01/2012 16:29, Dario Teixeira a écrit :
Hi,
Consider functions foobar1 and foobar2:
type 'a t = {id: int; x: 'a}
let foobar1: 'a -> 'a t =
fun x -> {id = 0; x}
let foobar2: 'a -> 'a t =
let ctr = ref 0 in
fun x -> incr ctr; {id = !ctr; x}
I would expec
Hi,
Consider functions foobar1 and foobar2:
type 'a t = {id: int; x: 'a}
let foobar1: 'a -> 'a t =
fun x -> {id = 0; x}
let foobar2: 'a -> 'a t =
let ctr = ref 0 in
fun x -> incr ctr; {id = !ctr; x}
I would expect them to have the same type, because foobar2's
use of