Browse thread
[Caml-list] yet another question on lazy lists
-
Michael Vanier
-
Pierre Weis
-
William Lovas
-
Michael Vanier
- John Max Skaller
-
Michael Vanier
-
William Lovas
-
Pierre Weis
[
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: | John Max Skaller <skaller@o...> |
| Subject: | Re: [Caml-list] yet another question on lazy lists |
>
>
>
>Right again. This is SICP terminology. I'll change it if I post any more
>questions on this subject to this list.
>
My understanding is that a list is a finite inductuive type,
characterised by constructors.
Whereas a stream is like an infinite list, but it is a coinductive type,
characterised by destructors:
'a list = Empty | Cons of 'a * 'a list
split ('a stream) -> 'a * 'a stream
As I understand it, the two types are formally dual.
See Charity (if you can find it) for a language which provides
coinductive types with a natural syntax which makes the duality
syntactically evident.
--
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850
-------------------
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