Browse thread
[Caml-list] Recursive lists
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] Recursive lists |
On Sat, 2004-10-09 at 18:35, Keith Wansbrough wrote: > > So there is actually a good argument for a Stream > > module with hd and tl functions (and lazy map ..) > > Even lazy map shouldn't do cycle-detection, though: I would expect a > cyclic stream to be mapped to an infinite one. Yes, what I meant was that for a data type s:'a stream, and a function f: 'a -> 'b, the function map f s : 'b stream creates a new stream represented by the pair (f,s) with hd (f,s) = f (hd s). In other words, the map is only applied when you fetch an element. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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