Hello Jean-Baptiste,

> Let us take an example using streams (infinite lists) of numbers:
> 
> type stream = Cons of int * stream

You won't go far with this type for integer streams, as the only way
to construct values of this type is "let rec", and it's severely
restricted (because of call-by-value requirements).  For instance, you
can't even define the stream of all integers 0.1.2.3.4...

The proper OCaml type for integer streams is

type stream = Cons of int * stream Lazy.t

and with this type you should be able to do pretty much everything you
want to do with your equations.

HTH,

- Xavier Leroy

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to