<?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="2006/02/a0059d9aa722817d34c90833ce0ad280"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-24T11:39:50"
  subject="Re: AW: [Caml-list] Map.fold behavior changed"
  prev="2006/02/579a51a1051b15f49ce25ed80aa0704c"
  next="2006/02/08aa1f53f8a7c6e0d96156f8e4d2ca20"
  prev-in-thread="2006/02/579a51a1051b15f49ce25ed80aa0704c"
  prev-thread="2006/02/023f7ed0bf61833401b5b03efebb8ad0"
  next-thread="2006/02/9f0ca6903d5847a3857caae30a564264"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="AW: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/579a51a1051b15f49ce25ed80aa0704c"
  from="Bauer, Christoph &lt;Christoph.Bauer@l...&gt;"
  author="Bauer, Christoph"
  date="2006-02-24T11:34:12"
  subject="AW: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/a0059d9aa722817d34c90833ce0ad280"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-24T11:39:50"
  subject="Re: AW: [Caml-list] Map.fold behavior changed">
</msg>
</msg>
</thread>

<contents>

Bauer, Christoph writes:
 &gt; What about to provide a "fold_left" (= new version) and "fold_right" 
 &gt; (= old version)? Fixing old programs would be simple. Combined with 
 &gt; exceptions there would be a fast solution (O(1) instead of O(n)) 
 &gt; to find a minimum and maximum key from a large map.

It would  be O(log(n)), not O(1),  since you still need  to descend to
the leftmost (resp. rightmost) element in a binary search tree to find
the minimum (resp. maximum) element.

-- 
Jean-Christophe Filliātre (http://www.lri.fr/~filliatr)

</contents>

</message>

