Skip to content

Commit

Permalink
Add example to Buf_read.seq documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
talex5 committed Jun 14, 2024
1 parent 77d8810 commit 8ef76f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib_eio/buf_read.mli
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ val seq : ?stop:bool parser -> 'a parser -> 'a Seq.t parser
It is not necessary to consume all the elements of the
sequence.
Example ([head 4] is a parser that takes 4 lines):
{[
let head n r =
r |> Buf_read.(seq line) |> Seq.take n |> List.of_seq
]}
@param stop This is used before parsing each item.
The sequence ends if this returns [true].
The default is {!at_end_of_input}. *)
Expand Down

0 comments on commit 8ef76f0

Please sign in to comment.