<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/1d39e152576c2aabdc0ee99c33754e7a"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-02T18:58:20"
  subject="Re: [Caml-list] simple typing question"
  prev="2002/07/9ae5bda85caec3e5e6a0f5988c05d8db"
  next="2002/07/562bfd7c9196fc3abcb454d8d4965868"
  prev-in-thread="2002/07/88db8213d1620c598904d4013899a04c"
  next-in-thread="2002/07/123444c4a1c6ba44fab849393fa7d36a"
  prev-thread="2002/07/6a74d59d6c9f1e932135281d10cf8619"
  next-thread="2002/07/562bfd7c9196fc3abcb454d8d4965868"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] simple typing question">
<msg 
  url="2002/07/1c3e421998b8c597856d6c991ff07910"
  from="Michael Vanier &lt;mvanier@c...&gt;"
  author="Michael Vanier"
  date="2002-07-02T08:49:58"
  subject="[Caml-list] simple typing question">
<msg 
  url="2002/07/3548469fc917388fb577cdf8c057664a"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2002-07-02T09:15:02"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/21b0e21b4ac0db4ec833fe28522ef6f2"
  from="Michael Vanier &lt;mvanier@c...&gt;"
  author="Michael Vanier"
  date="2002-07-02T11:15:35"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/13283d87244d3adbaa5e21df29c68d64"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-02T11:29:42"
  subject="Re: [Caml-list] simple typing question">
</msg>
<msg 
  url="2002/07/88db8213d1620c598904d4013899a04c"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-02T11:42:30"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/1d39e152576c2aabdc0ee99c33754e7a"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-02T18:58:20"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/123444c4a1c6ba44fab849393fa7d36a"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2002-07-02T20:59:26"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/26a23ba53cb0bf9c78b38c87c89f50a7"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-03T00:39:46"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/dc5aba42df0bce5e2da1527c3201263e"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-03T01:50:55"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/371811a059d4c9d0b4de447e979f5e7b"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-03T23:25:20"
  subject="Re: [Caml-list] simple typing question">
</msg>
</msg>
<msg 
  url="2002/07/75d4aecf09efc05caede6b7c53c1292f"
  from="Francois Pottier &lt;francois.pottier@i...&gt;"
  author="Francois Pottier"
  date="2002-07-03T07:51:33"
  subject="Re: [Caml-list] simple typing question">
<msg 
  url="2002/07/edca71d918b76a8f602f512abd5e99ee"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-03T11:26:42"
  subject="Re: [Caml-list] simple typing question">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/6af4fa15d93ed642e822426130a5b6d3"
  from="Lauri Alanko &lt;la@i...&gt;"
  author="Lauri Alanko"
  date="2002-07-04T14:55:06"
  subject="Re: [Caml-list] simple typing question">
</msg>
</msg>
<msg 
  url="2002/07/aec9d45534764d309bdb86d17d40cd38"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2002-07-02T14:56:26"
  subject="Re: [Caml-list] simple typing question">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Xavier Leroy &lt;xavier.leroy@inria.fr&gt; writes:

&gt; No reasonably simple type system can distinguish both examples.  Many
&gt; have been proposed -- this was a hot research topic in the 1980-1993
&gt; time frame, and I even did my PhD on this very topic -- but none was
&gt; found to be really usable in practice.  The value restriction on
&gt; polymorphism (i.e. what Caml implements) is far from perfect, but is
&gt; the "least bad" of the known solutions.

what about changing the semantic of partial application, restoring
eta-equivalence: a function is not evaluated unless every arguments
are given:

make_toggle()  &lt;=&gt;  fun x -&gt; make_toggle () x


of course this makes functions like "make_toggle" quite useless:

# let make_toggle () =
    let r = ref [] in fun x -&gt; let old = !r in r := x; old

would be semantically equivalent to

# let make_toggle () x =
    let r = ref [] in let old = !r in r := x; old

To get back the power of "make_toggle"-like functions, a special
function call could be added that would break eta-equivalence:
  call_now(make_toggle, ())
would have the semantic "make_toggle()" has in today's caml.


The rationale for this change would be that "make_toggle"-like
functions are seldom used, whereas "map"-like are used a lot.
Differentiating syntactically them would be nice.

But i don't think such a big change would do caml any good:
- are "make_toggle"-like functions really seldom used?
- performance drawbacks?


(i've been toying around the syntactical pb of partial application:
 http://merd.net/choices_syntax.html)
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

