caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jun Mukai <mukai@ayu.ics.keio.ac.jp>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] lazy lists
Date: Fri, 26 Aug 2005 20:16:06 +0900	[thread overview]
Message-ID: <kk5hddd3q4p.wl%mukai@ayu.ics.keio.ac.jp> (raw)
In-Reply-To: <20050826110454.GA21632@furbychan.cocan.org>

Hi, Rich

> What you probably want are Streams (in camlp4).  This thread is
> interesting:

It is true that Stream is lazy evaluated, but Stream is not functional
at all. We cannot use Streams as same as lists in Haskell. For example,
--
# let s = [< '1 >];;
val s : int Stream.t = <abstr>
# let f = parser
  | [< 'n >] -> n
  | [< >] -> raise Not_found;;
val f : 'a Stream.t -> 'a = <fun>
# f s;;
- : int = 1
# f s;;
Exception: Not_found.
--

This code confuses many users (such like me).


BTW, I wrote a lazy list implementation in pure OCaml. It uses lazy
mechanism of OCaml and has some useful functions like haskell.
If you are interested in, see 
http://www.jmuk.org/prog/lazyList.tar.gz

The implementation is so naive that its performance will be low. And
it has no camlp4 extentions.
Feel free to use, but without any warranty.

Best Regards,
--
Jun Mukai


  reply	other threads:[~2005-08-26 11:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-25 23:56 Jonathan Roewen
2005-08-26 10:56 ` Marius Nita
2005-08-26 11:04 ` Richard Jones
2005-08-26 11:16   ` Jun Mukai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-05-01 14:10 Yitzhak Mandelbaum
2007-05-01 15:47 ` [Caml-list] " Loup Vaillant
2007-05-01 19:43   ` Jon Harrop
2007-05-02  7:16     ` Nicolas Pouillard
2007-05-02 10:03       ` Loup Vaillant
2007-05-02 10:15         ` Daniel de Rauglaudre
2002-07-03  9:45 Michael Vanier
2002-07-03 22:04 ` Remi VANICAT

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=kk5hddd3q4p.wl%mukai@ayu.ics.keio.ac.jp \
    --to=mukai@ayu.ics.keio.ac.jp \
    --cc=caml-list@yquem.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).