Module Prime_buffer

Amendment to the standard library Buffer structure.

val with0 : ?⁠n:int -> (Stdlib.Buffer.t -> unit) -> string

with0 f calls f buf on a fresh buffer buf and returns its content.

val with1 : ?⁠n:int -> (Stdlib.Buffer.t -> 'a -> unit) -> 'a -> string

with1 f x0 calls f buf x0 on a fresh buffer buf and returns its content.

val with2 : ?⁠n:int -> (Stdlib.Buffer.t -> 'a -> 'b -> unit) -> 'a -> 'b -> string

with2 f x0 x1 calls f buf x0 x1 on a fresh buffer buf and returns its content.