English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] lazy lists
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-03 (16:15)
From: Michael Vanier <mvanier@c...>
Subject: [Caml-list] lazy lists

What's the best way to write a lazy list data type in ocaml?  I've been
playing around with this datatype (from an old mailing list posting):

type 'a stream =
| Cons of 'a Lazy.t * 'a stream Lazy.t

but I can't figure out how to write a "stream_cons" function.  Also, it
appears that the Lazy.t data type uses references; why is this?

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