From: Jacques Le Normand <rathereasy@gmail.com>
To: caml-list caml-list <caml-list@yquem.inria.fr>
Subject: Re: value restriction
Date: Sat, 2 Jan 2010 11:25:25 -0500 [thread overview]
Message-ID: <f74178431001020825u7f6bb3f3l8e63c5ae23abb2a3@mail.gmail.com> (raw)
In-Reply-To: <f74178431001011505j55d34a85v36b03aacbd7a4506@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
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>
baz clearly has a polymorphic type, yet foo doesn't.
Is there any way around this ?
--Jacques L.
On Fri, Jan 1, 2010 at 6:05 PM, Jacques Le Normand <rathereasy@gmail.com>wrote:
> Hello caml-list,
> with respect to the value restriction, what exactly constitutes a value?
> the textbook definition doesn't seem to hold, since the following
> generalizes:
>
> let f = let x = 1 in fun g h x -> g (h x);;
>
> while this won't:
>
> let f () = let x = (fun x -> x) (fun x -> x) in fun g h x -> g (h x);;
>
> cheers
>
> --Jacques L.
>
[-- Attachment #2: Type: text/html, Size: 1370 bytes --]
next prev parent reply other threads:[~2010-01-02 16:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-01 23:05 Jacques Le Normand
2010-01-02 16:25 ` Jacques Le Normand [this message]
2010-01-02 16:46 ` [Caml-list] " Andrej Bauer
2010-01-02 23:09 ` Philippe Wang
2010-01-03 0:30 ` Kaustuv Chaudhuri
-- strict thread matches above, loose matches on Subject: below --
2006-11-17 3:09 Jacques Carette
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f74178431001020825u7f6bb3f3l8e63c5ae23abb2a3@mail.gmail.com \
--to=rathereasy@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox