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] Streams.from
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Streams.from
Jean-Christophe Filliatre <> writes:

> Nick Grey writes:
>  > 
>  > When a stream is created using Stream.from, is the function f garunteed
>  > to be called with the stream count parameter 0, 1, 2, ...
> No. For instance, repeated calls to Stream.peek will clearly call f
> several times on the same count value (see the code in
> stdlib/

Stream.peek cache value from parser created by Stream.from. So the
answer is that with the current implementation of all the function of
the module Stream, f will be call one, and only one time for each
count parameter, and in the good order. But this is not written in the

Rémi Vanicat
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: