caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Strange behavior of mutualy recursive definitions
Date: Thu, 28 Apr 2011 09:26:10 +0200	[thread overview]
Message-ID: <4DB91692.5000305@inria.fr> (raw)
In-Reply-To: <244248468.756230.1303963610378.JavaMail.root@zmbs4.inria.fr>

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

On 04/28/2011 06:06 AM, rixed@happyleptic.org wrote:
> Although "let rec f = f" is unsound and rejected as expected,
> why is "let rec f : unit -> unit = f" also rejected, since it seams
> trivially equivalent to "let rec f () : unit = f ()" (which is
> accepted) ?

Eta-conversion (transforming "let f = f into let f () = f ()") is
unsound in the general case. Indeed, take for example:

let f () = print_string "titi"; function () -> print_string "toto"

Is "let g = f ()" equivalent to "let g () = f () ()" ? No.

So, no eta-expansion is ever performed using only type information.

Fabrice

[-- Attachment #2: fabrice_le_fessant.vcf --]
[-- Type: text/x-vcard, Size: 380 bytes --]

begin:vcard
fn:Fabrice LE FESSANT
n:LE FESSANT;Fabrice
org:INRIA Saclay -- Ile-de-France;P2P & OCaml
adr;quoted-printable:;;Parc Orsay Universit=C3=A9 ;Orsay CEDEX;;91893;France
email;internet:fabrice.le_fessant@inria.fr
title;quoted-printable:Charg=C3=A9 de Recherche
tel;work:+33 1 74 85 42 14
tel;fax:+33 1 74 85 42 49 
url:http://fabrice.lefessant.net/
version:2.1
end:vcard


  parent reply	other threads:[~2011-04-28  8:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 20:46 rixed
2011-04-27 20:54 ` Guillaume Yziquel
2011-04-27 21:28   ` rixed
2011-04-27 21:51     ` Guillaume Yziquel
2011-04-28  4:05       ` rixed
2011-04-28  6:24         ` [Caml-list] " Jeffrey Scofield
2011-04-28  8:45           ` Guillaume Yziquel
2011-04-28  8:57             ` rixed
     [not found]       ` <244248468.756230.1303963610378.JavaMail.root@zmbs4.inria.fr>
2011-04-28  7:26         ` Fabrice Le Fessant [this message]
2011-04-28  8:53           ` [Caml-list] " rixed

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=4DB91692.5000305@inria.fr \
    --to=fabrice.le_fessant@inria.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).