package parseff

  1. Overview
  2. Docs
Direct-style parser combinator library for OCaml 5 powered by algebraic effects

Install

dune-project
 Dependency

Authors

Maintainers

Sources

parseff-0.1.0.tbz
sha256=097c71a38b39ab5925518e16c0efdf3b77a6b3b2185c82f168e0f1f4cb0772bf
sha512=811fbd770148bf3004ffc764dc08fa1a3ded9b4613f5749a6d2841c1af868de7afff4dd6b808b38254d28592433e23613573707159dfa171687839c520e93bb3

doc/parseff/Parseff/Source/index.html

Module Parseff.SourceSource

Input sources for incremental parsing. A source wraps a readable byte stream — a channel, file descriptor, or custom reader — behind a uniform interface. The parser pulls data on demand through the effect handler; existing parser code works unchanged.

Sourcetype t
Sourceval of_string : string -> t

of_string s creates a source from a complete string. Useful for testing streaming code paths with known input.

Sourceval of_channel : ?buf_size:int -> in_channel -> t

of_channel ?buf_size ic creates a source that reads from ic. buf_size controls the internal read buffer (default 4096).

Sourceval of_function : (bytes -> int -> int -> int) -> t

of_function read creates a source that calls read buf off len to obtain up to len bytes starting at offset off in buf. Must return the number of bytes actually read; return 0 to signal EOF.