Version franÁaise
Home ††† About ††† Download ††† Resources ††† Contact us †††
Browse thread
value restriction
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andrej Bauer <andrej.bauer@a...>
Subject: Re: [Caml-list] Re: value restriction
> on another note (but staying very much on the same topic), why won't the
> following generalize:
> # let foo =
>     let counter  = ref 0 in
>     let bar = !counter  in
>     let baz = fun x -> bar
>     in
>       baz
>
> val foo : '_a -> int = <fun>

It's even worse:

        Objective Caml version 3.11.1

# let _ = ref () in fun x -> x ;;
- : '_a -> '_a = <fun>

I am sure this makes sense in France. Happy new year!

Andrej