caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jeffrey Loren Shaw" <shawjef3@msu.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] possible way to improve "lazy"
Date: Tue, 20 Mar 2007 21:06:01 -0400	[thread overview]
Message-ID: <E1HTpH7-0002er-Fg@sys18.mail.msu.edu> (raw)
In-Reply-To: <4000A41B-9DE0-42A5-A25B-44F98F7D27DD@epfl.ch>

Daniel, 

Thanks for that link! It looks like this has been discussed at some length. 

Well hm, I guess consider my post a request for renewed effort on this 
front. Lazy evaluation can be very useful, and since caml already supports 
it, it'd be nice if it were easier to use. 

Zheng Li,
Yes that's exactly what I'm asking for! It'd be really cool to have in caml 
IMO. 

type 'a t = 'a * 'a t Lazy.t;; 

This will work for infinite lists, but there is no empty list, so it's not 
quite a proper lazy list. 

And streams aren't right either, because they are destructive. If you ask 
for the 3rd element on a lazy list, you can still ask for the 1st and 2nd 
elements, whereas streams are unable to recover the previous values. This 
has its applications but it's not the same as a list. 

Thanks for the posts! I'll keep plugging away to try and get my 
combinatorial parser to work perfectly lazy. I'm close but I'm having 
trouble with sequencing. 

Jeff


      reply	other threads:[~2007-03-21  1:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20 18:50 Jeffrey Loren Shaw
2007-03-20 21:53 ` Zheng Li
2007-03-20 23:39 ` [Caml-list] " Daniel Bünzli
2007-03-21  1:06   ` Jeffrey Loren Shaw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1HTpH7-0002er-Fg@sys18.mail.msu.edu \
    --to=shawjef3@msu.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).