Skip to content

Commit 17562f2

Browse files
authored
Merge pull request #739 from talex5/doc-seq
Add example to `Buf_read.seq` documentation
2 parents 77d8810 + 8ef76f0 commit 17562f2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib_eio/buf_read.mli

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ val seq : ?stop:bool parser -> 'a parser -> 'a Seq.t parser
218218
It is not necessary to consume all the elements of the
219219
sequence.
220220
221+
Example ([head 4] is a parser that takes 4 lines):
222+
223+
{[
224+
let head n r =
225+
r |> Buf_read.(seq line) |> Seq.take n |> List.of_seq
226+
]}
227+
221228
@param stop This is used before parsing each item.
222229
The sequence ends if this returns [true].
223230
The default is {!at_end_of_input}. *)

0 commit comments

Comments
 (0)