Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Queue.fold?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alessandro Baretta <alex@b...>
Subject: [Caml-list] Queue.fold?
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 -> 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