<?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/26a23ba53cb0bf9c78b38c87c89f50a7"
  from="Pixel &lt;pixel@m...&gt;"
  author="Pixel"
  date="2002-07-03T00:39:46"
  subject="Re: [Caml-list] simple typing question"
  prev="2002/07/1938bd06a7295f31e5fee044ccfdda3a"
  next="2002/07/dc5aba42df0bce5e2da1527c3201263e"
  prev-in-thread="2002/07/123444c4a1c6ba44fab849393fa7d36a"
  next-in-thread="2002/07/dc5aba42df0bce5e2da1527c3201263e"
  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>
Pierre Weis &lt;pierre.weis@inria.fr&gt; writes:

&gt; &gt; what about changing the semantic of partial application, restoring
&gt; &gt; eta-equivalence: a function is not evaluated unless every arguments
&gt; &gt; are given:
&gt; 
&gt; Could you precisely state this notion ? In the presence of higher
&gt; order functions and imperative features, this does not appear to be
&gt; simple and evident to me...

well, wrap every functions:

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

with

# let make_toggle a b = make_toggle_ a b

based on the number of parameters of functions (given by the type).

This disables evaluation of a function until every parameters are
provided.


The program transformation involved is something like:
  let t = foo in fun x -&gt; bar
gives
  fun x -&gt; let t = foo in bar

ie
  (fun t -&gt; (fun x -&gt; bar)) foo
gives
  (fun x -&gt; (fun t -&gt; bar) foo)

&gt; (Let alone recursive functions and types as in
&gt; $ ocaml -rectypes
&gt; # let rec print x = print_int x; print;;
&gt; val print : int -&gt; 'a as 'a = &lt;fun&gt;
&gt; # print 1 2 3;;
&gt; 123- : int -&gt; 'a as 'a = &lt;fun&gt;

of course it doesn't work nicely for this since the "number of
parameters" doesn't mean anything, so you can't know when you can
start evaluating.
-------------------
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>

