Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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

[ 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


with hd (f,s) = f (hd s). In other words, the map is only
applied when you fetch an element.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: