On Thu, 10 Aug 2006, Error404 wrote: > Hi, > > I'm looking for some streams related tutorial or any other info. > By stream i mean something like this (I don't know exact definition): > > open Lazy;; > type 'a stream = Nil | Cons of 'a Lazy.t * 'a stream Lazy.t;; > > (* For example stream of 'integers from x' would look like this: *) > > let rec intsfrom x = > Cons(lazy x,lazy (intsfrom (x+1)));; > > If you know any www/book or anything on this kind of streams please mail me (error92@tlen.pl). > Many thanks. I call this a lazy list. Anyway, I use the following definition: type 'a l = Empty | Cons of 'a * 'a t and 'a t = 'a l lazy_t (* only one lazy object per cell *) See attachment for the full implementation. You can manipulate such lists like real lists, only the syntax is less comfortable. They are different from streams in the sense of the standard Stream module, which are mutable. Martin -- Martin Jambon, PhD http://martin.jambon.free.fr