From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA09412; Wed, 28 Apr 2004 19:07:53 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA09401 for ; Wed, 28 Apr 2004 19:07:52 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from wetware.com (wetware.wetware.com [199.108.16.1]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3SH7oYM031097 for ; Wed, 28 Apr 2004 19:07:51 +0200 Received: from [208.177.152.17] (helo=[10.0.1.5]) by wetware.com with esmtp (Exim 4.20) id 1BIsXG-0006aK-Ba for caml-list@inria.fr; Wed, 28 Apr 2004 10:07:50 -0700 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <1083151482.9537.904.camel@pelican.wigram> References: <200404280613.19547.jdh30@cam.ac.uk> <1083141467.9537.845.camel@pelican.wigram> <200404281018.14913.jdh30@cam.ac.uk> <1083151482.9537.904.camel@pelican.wigram> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <93ADD9EA-9936-11D8-BD03-000A958FF2FE@wetware.com> Content-Transfer-Encoding: 7bit From: james woodyatt Subject: Re: [Caml-list] [ANN] The Missing Library Date: Wed, 28 Apr 2004 10:07:49 -0700 To: caml-list X-Mailer: Apple Mail (2.613) X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; woodyatt:01 jhw:01 wetware:01 caml-list:01 iterator:01 inverted:01 abstraction:01 abstraction:01 fstream:01 camlp:01 seq:01 lazily:01 monadic:01 monadic:01 convoluted:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 28 Apr 2004, at 04:24, skaller wrote: > > to say another way: an iterator IS just a control inverted > HOF, indeed, the (abstraction of) the List.iter HOF. Also not precisely true, since iterators are typically lazy evaluations of the underlying container. It would be more precise to say that they are an abstraction of the FStream module in the CamlP4 distribution. (I have a similar module in my Cf library, called Cf_seq, which I think offers more functionality, so that's what I use.) It's possible to do a whole helluva lot with lazily evaluated functional streams and monadic programming. With Ocaml, monadic programming is a little more convoluted than with Haskell, but it's not at all out of the bounds of reality. I do it all the time, and I don't miss the C++ STL (or Stepanov's original work) even a little bit. In fact, I suspect there are things I would consider trivial to do with monads and functional streams that the C++ STL just falls down and dies when you try to torture it into allowing. -- j h woodyatt markets are only free to the people who own them. ------------------- 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