caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* lazy lists
@ 2007-05-01 14:10 Yitzhak Mandelbaum
  2007-05-01 15:47 ` [Caml-list] " Loup Vaillant
  0 siblings, 1 reply; 6+ messages in thread
From: Yitzhak Mandelbaum @ 2007-05-01 14:10 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

Hi,

Does anyone have/know of a lazy list module for ocaml? I couldn't  
find anything on the hump.

Thanks!
Yitzhak

--------------------------------------------------
Yitzhak Mandelbaum
AT&T Labs - Research

http://www.research.att.com/~yitzhak



[-- Attachment #2: Type: text/html, Size: 2545 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] lazy lists
  2007-05-01 14:10 lazy lists Yitzhak Mandelbaum
@ 2007-05-01 15:47 ` Loup Vaillant
  2007-05-01 19:43   ` Jon Harrop
  0 siblings, 1 reply; 6+ messages in thread
From: Loup Vaillant @ 2007-05-01 15:47 UTC (permalink / raw)
  To: caml-list

2007/5/1, Yitzhak Mandelbaum <yitzhak@research.att.com>:
> Hi,
>
> Does anyone have/know of a lazy list module for ocaml? I couldn't find
> anything on the hump.

The equivalent is the functionnal streams, describe briefly in the
camlp4 manual.

Another possibilty is to code it yourself. I think you can imitate
most of the List module code.

Regards,
Loup


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] lazy lists
  2007-05-01 15:47 ` [Caml-list] " Loup Vaillant
@ 2007-05-01 19:43   ` Jon Harrop
  2007-05-02  7:16     ` Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Harrop @ 2007-05-01 19:43 UTC (permalink / raw)
  To: caml-list

On Tuesday 01 May 2007 16:47, Loup Vaillant wrote:
> The equivalent is the functionnal streams, describe briefly in the
> camlp4 manual.

Aren't ocaml stream destructive?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] lazy lists
  2007-05-01 19:43   ` Jon Harrop
@ 2007-05-02  7:16     ` Nicolas Pouillard
  2007-05-02 10:03       ` Loup Vaillant
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2007-05-02  7:16 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On 5/1/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Tuesday 01 May 2007 16:47, Loup Vaillant wrote:
> > The equivalent is the functionnal streams, describe briefly in the
> > camlp4 manual.
>
> Aren't ocaml stream destructive?

Yes they are.

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] lazy lists
  2007-05-02  7:16     ` Nicolas Pouillard
@ 2007-05-02 10:03       ` Loup Vaillant
  2007-05-02 10:15         ` Daniel de Rauglaudre
  0 siblings, 1 reply; 6+ messages in thread
From: Loup Vaillant @ 2007-05-02 10:03 UTC (permalink / raw)
  To: Caml mailing list

2007/5/2, Nicolas Pouillard <nicolas.pouillard@gmail.com>:
> On 5/1/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> > On Tuesday 01 May 2007 16:47, Loup Vaillant wrote:
> > > The equivalent is the functionnal streams, describe briefly in the
> > > camlp4 manual.
> >
> > Aren't ocaml stream destructive?
>
> Yes they are.

Regular streams are destructive. I was talking about "functional"
ones. I didn't try them myself, but the manual says one can perform
left recursion with them (thanks to their non destructive nature).
Mind the pattern matching, though: it is quite different from the one
used with regular streams.

the syntax looks like:

let f s = match s with fparser (* and not just 'parser' *)
...

If I remember well.

Loup Vaillant


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] lazy lists
  2007-05-02 10:03       ` Loup Vaillant
@ 2007-05-02 10:15         ` Daniel de Rauglaudre
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel de Rauglaudre @ 2007-05-02 10:15 UTC (permalink / raw)
  To: caml-list

Hi,

On Wed, May 02, 2007 at 12:03:29PM +0200, Loup Vaillant wrote:

> Regular streams are destructive. I was talking about "functional"
> ones. I didn't try them myself, but the manual says one can perform
> left recursion with them (thanks to their non destructive nature).

Use camlp4s : the library "fstream" and the syntax extension "pa_fstream"
are still there. Access and download from my home page below.

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/index-english.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-02 10:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-01 14:10 lazy lists 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

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