<?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/e81b73bce67f7e5d0f3b86f58223fa7a"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T20:06:42"
  subject="[Caml-list] Queue.fold?"
  prev="2002/07/429a6ddd7c1da1d3259de9ec4b1a2c13"
  next="2002/07/a1ca4da67b523a553308e8fc7edcb776"
  next-in-thread="2002/07/54f51c27ee0b81ae764b1dd088861b17"
  prev-thread="2002/07/d5f6a0e09d16d16e59654421a594d69a"
  next-thread="2002/07/ef445170aabc78ef9d83bf0884c13ff5"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Queue.fold?">
<msg 
  url="2002/07/e81b73bce67f7e5d0f3b86f58223fa7a"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T20:06:42"
  subject="[Caml-list] Queue.fold?">
<msg 
  url="2002/07/54f51c27ee0b81ae764b1dd088861b17"
  from="Francois Pottier &lt;francois.pottier@i...&gt;"
  author="Francois Pottier"
  date="2002-07-17T07:19:34"
  subject="Re: [Caml-list] Queue.fold?">
<msg 
  url="2002/07/3f2c225830669dce5d13a01570f43023"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-17T08:13:48"
  subject="Re: [Caml-list] Queue.fold?">
</msg>
</msg>
</msg>
</thread>

<contents>
Is there any specific reason for not having a Queue.fold 
function in the standard library? Is it not as simple as this?

let rec fold f initial queue =
   try
     fold f ( f initial (take queue) ) queue
   with Empty -&gt; initial

Alex

-------------------
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>

