gen
Iterators for OCaml, both restartable and consumable
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
read filename f
opens filename
and calls f g
, where g
is a clonable generator of characters from the file. It can be cloned by calling g#save
(which saves the position in the file), and used with g#next
. Distinct clones of g
shouldn't be used at the same time (otherwise Failure _
will be raised). Both the generator and save points are only valid within the scope in which f
is called.