Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.
Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.
Fold over elements of the iterator and their index, consuming it
val fold_map : ('acc->'a->'acc * 'b) ->'acc->'at->'bt
fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.
since
0.9
val fold_filter_map : ('acc->'a->'acc * 'b option) ->'acc->'at->'bt
fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.
Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!
Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.
warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.
Checks whether the iterator is sorted. Eager, same as sort.
since
0.9
val group_succ_by : ?eq:('a->'a-> bool) ->'at->'a list t
Group equal consecutive elements. Linear time. Formerly synonym to group.
since
0.6
val group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, disregarding their order of appearance. The result iterator is traversable as many times as required. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.6
val count : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at-> ('a * int) t
Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.
Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.
All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.
since
0.9
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val join_all_by : ?eq:'keyequal-> ?hash:'keyhash-> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
0.10
val group_join_by : ?eq:'aequal-> ?hash:'ahash-> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
Set-like
val inter : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val union : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val diff : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Set difference. Eager.
since
0.10
val subset : ?eq:'aequal-> ?hash:'ahash->'at->'at-> bool
subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.
Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.
Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.
Concatenate strings together, eagerly. Also see intersperse to add a separator.
since
0.5
exceptionOneShotSequence
Raised when the user tries to iterate several times on a transient iterator
val of_in_channel : Pervasives.in_channel -> char t
Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.
Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.
val int_range_dec : start:int -> stop:int -> int t
Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version
val int_range_by : step:int -> int -> int -> int t
int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.
val pp_seq : ?sep:string -> (Format.formatter ->'a-> unit) -> Format.formatter ->'at-> unit
Pretty print an iterator of 'a, using the given pretty printer to print each elements. An optional separator string can be provided.
val pp_buf : ?sep:string -> (Buffer.t ->'a-> unit) -> Buffer.t ->'at-> unit
Print into a buffer
val to_string : ?sep:string -> ('a-> string) ->'at-> string
Print into a string
Basic IO
Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.
Example: copy a file "a" into file "b", removing blank lines:
Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.
Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.
Fold over elements of the iterator and their index, consuming it
val fold_map : ('acc->'a->'acc * 'b) ->'acc->'at->'bt
fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.
since
0.9
val fold_filter_map : ('acc->'a->'acc * 'b option) ->'acc->'at->'bt
fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.
Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!
Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.
warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.
Checks whether the iterator is sorted. Eager, same as sort.
since
0.9
val group_succ_by : ?eq:('a->'a-> bool) ->'at->'a list t
Group equal consecutive elements. Linear time. Formerly synonym to group.
since
0.6
val group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, disregarding their order of appearance. The result iterator is traversable as many times as required. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.6
val count : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at-> ('a * int) t
Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.
Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.
All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.
since
0.9
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val join_all_by : ?eq:'keyequal-> ?hash:'keyhash-> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
0.10
val group_join_by : ?eq:'aequal-> ?hash:'ahash-> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
Set-like
val inter : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val union : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val diff : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Set difference. Eager.
since
0.10
val subset : ?eq:'aequal-> ?hash:'ahash->'at->'at-> bool
subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.
Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.
Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.
Concatenate strings together, eagerly. Also see intersperse to add a separator.
since
0.5
exceptionOneShotSequence
Raised when the user tries to iterate several times on a transient iterator
val of_in_channel : Pervasives.in_channel -> char t
Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.
Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.
val int_range_dec : start:int -> stop:int -> int t
Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version
val int_range_by : step:int -> int -> int -> int t
int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.
val pp_seq : ?sep:string -> (Format.formatter ->'a-> unit) -> Format.formatter ->'at-> unit
Pretty print an iterator of 'a, using the given pretty printer to print each elements. An optional separator string can be provided.
val pp_buf : ?sep:string -> (Buffer.t ->'a-> unit) -> Buffer.t ->'at-> unit
Print into a buffer
val to_string : ?sep:string -> ('a-> string) ->'at-> string
Print into a string
Basic IO
Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.
Example: copy a file "a" into file "b", removing blank lines:
\ No newline at end of file
diff --git a/doc/dev/sequence/Sequence/index.html b/doc/dev/sequence/Sequence/index.html
index 52b1813..f4fde31 100644
--- a/doc/dev/sequence/Sequence/index.html
+++ b/doc/dev/sequence/Sequence/index.html
@@ -1,2 +1,2 @@
-Sequence (sequence.Sequence)
Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.
Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.
Fold over elements of the iterator and their index, consuming it
val fold_map : ('acc->'a->'acc * 'b) ->'acc->'at->'bt
fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.
since
0.9
val fold_filter_map : ('acc->'a->'acc * 'b option) ->'acc->'at->'bt
fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.
Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!
Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.
warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.
Checks whether the iterator is sorted. Eager, same as sort.
since
0.9
val group_succ_by : ?eq:('a->'a-> bool) ->'at->'a list t
Group equal consecutive elements. Linear time. Formerly synonym to group.
since
0.6
val group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, disregarding their order of appearance. The result iterator is traversable as many times as required. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.6
val count : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at-> ('a * int) t
Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.
Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.
All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.
since
0.9
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val join_all_by : ?eq:'keyequal-> ?hash:'keyhash-> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
0.10
val group_join_by : ?eq:'aequal-> ?hash:'ahash-> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
Set-like
val inter : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val union : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val diff : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Set difference. Eager.
since
0.10
val subset : ?eq:'aequal-> ?hash:'ahash->'at->'at-> bool
subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.
Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.
Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.
Concatenate strings together, eagerly. Also see intersperse to add a separator.
since
0.5
exceptionOneShotSequence
Raised when the user tries to iterate several times on a transient iterator
val of_in_channel : Pervasives.in_channel -> char t
Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.
Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.
val int_range_dec : start:int -> stop:int -> int t
Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version
val int_range_by : step:int -> int -> int -> int t
int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.
val pp_seq : ?sep:string -> (Format.formatter ->'a-> unit) -> Format.formatter ->'at-> unit
Pretty print an iterator of 'a, using the given pretty printer to print each elements. An optional separator string can be provided.
val pp_buf : ?sep:string -> (Buffer.t ->'a-> unit) -> Buffer.t ->'at-> unit
Print into a buffer
val to_string : ?sep:string -> ('a-> string) ->'at-> string
Print into a string
Basic IO
Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.
Example: copy a file "a" into file "b", removing blank lines:
Iterator that calls the given function to produce elements. The iterator may be transient (depending on the function), and definitely is infinite. You may want to use take and persistent.
Cycle forever through the given iterator. Assume the given iterator can be traversed any amount of times (not transient). This yields an infinite iterator, you should use something like take not to loop forever.
Fold over elements of the iterator and their index, consuming it
val fold_map : ('acc->'a->'acc * 'b) ->'acc->'at->'bt
fold_map f acc l is like map, but it carries some state as in fold. The state is not returned, it is just used to thread some information to the map function.
since
0.9
val fold_filter_map : ('acc->'a->'acc * 'b option) ->'acc->'at->'bt
fold_filter_map f acc l is a fold_map-like function, but the function can choose to skip an element by retuning None.
Iterate on the iterator, storing elements in an efficient internal structure.. The resulting iterator can be iterated on as many times as needed. Note: calling persistent on an already persistent iterator will still make a new copy of the iterator!
Lazy version of persistent. When calling persistent_lazy s, a new iterator s' is immediately returned (without actually consuming s) in constant time; the first time s' is iterated on, it also consumes s and caches its content into a inner data structure that will back s' for future iterations.
warning: on the first traversal of s', if the traversal is interrupted prematurely (take, etc.) then s' will not be memorized, and the next call to s' will traverse s again.
Checks whether the iterator is sorted. Eager, same as sort.
since
0.9
val group_succ_by : ?eq:('a->'a-> bool) ->'at->'a list t
Group equal consecutive elements. Linear time. Formerly synonym to group.
since
0.6
val group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, disregarding their order of appearance. The result iterator is traversable as many times as required. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.6
val count : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at-> ('a * int) t
Map each distinct element to its number of occurrences in the whole seq. Similar to group_by seq |> map (fun l->List.hd l, List.length l) precondition: for any x and y, if eq x y then hash x=hash y must hold.
Cartesian product of iterators. When calling product a b, the caller MUST ensure that b can be traversed as many times as required (several times), possibly by calling persistent on it beforehand.
All pairs of distinct positions of the iterator. Iterates only once on the iterator, which must be finite.
since
0.9
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val join_all_by : ?eq:'keyequal-> ?hash:'keyhash-> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two iterators a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
0.10
val group_join_by : ?eq:'aequal-> ?hash:'ahash-> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first iterator, all the elements y of the second iterator such that eq x (key y). Elements of the first iterators without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
Set-like
val inter : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Intersection of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val union : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Union of two collections. Each element will occur at most once in the result. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
0.10
val diff : ?eq:'aequal-> ?hash:'ahash->'at->'at->'at
Set difference. Eager.
since
0.10
val subset : ?eq:'aequal-> ?hash:'ahash->'at->'at-> bool
subset a b returns true if all elements of a belong to b. Eager. precondition: for any x and y, if eq x y then hash x=hash y must hold.
Take elements while they satisfy the predicate, then stops iterating. Will work on an infinite iterator s if the predicate is false for at least one element of s.
Reverse the iterator. O(n) memory and time, needs the iterator to be finite. The result is persistent and does not depend on the input being repeatable.
Convert the iterator into a list. Preserves order of elements. This function is tail-recursive, but consumes 2*n memory. If order doesn't matter to you, consider to_rev_list.
Concatenate strings together, eagerly. Also see intersperse to add a separator.
since
0.5
exceptionOneShotSequence
Raised when the user tries to iterate several times on a transient iterator
val of_in_channel : Pervasives.in_channel -> char t
Iterates on characters of the input (can block when one iterates over the iterator). If you need to iterate several times on this iterator, use persistent.
Iterator on integers in start...stop by steps 1. Also see (--) for an infix version.
val int_range_dec : start:int -> stop:int -> int t
Iterator on decreasing integers in stop...start by steps -1. See (--^) for an infix version
val int_range_by : step:int -> int -> int -> int t
int_range_by ~step i j is the range starting at i, including j, where the difference between successive elements is step. use a negative step for a decreasing iterator.
val pp_seq : ?sep:string -> (Format.formatter ->'a-> unit) -> Format.formatter ->'at-> unit
Pretty print an iterator of 'a, using the given pretty printer to print each elements. An optional separator string can be provided.
val pp_buf : ?sep:string -> (Buffer.t ->'a-> unit) -> Buffer.t ->'at-> unit
Print into a buffer
val to_string : ?sep:string -> ('a-> string) ->'at-> string
Print into a string
Basic IO
Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.
Example: copy a file "a" into file "b", removing blank lines: