Pure OCaml Yaml 1.2 reader and writer using Bytesrw
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** YAML sequence (array) values with metadata *)
7
8type 'a t
9
10val make :
11 ?anchor:string ->
12 ?tag:string ->
13 ?implicit:bool ->
14 ?style:Layout_style.t ->
15 'a list -> 'a t
16(** Create a sequence *)
17
18(** {2 Accessors} *)
19
20val members : 'a t -> 'a list
21val anchor : 'a t -> string option
22val tag : 'a t -> string option
23val implicit : 'a t -> bool
24val style : 'a t -> Layout_style.t
25
26(** {2 Modifiers} *)
27
28val with_anchor : string -> 'a t -> 'a t
29val with_tag : string -> 'a t -> 'a t
30val with_style : Layout_style.t -> 'a t -> 'a t
31
32(** {2 Operations} *)
33
34val map : ('a -> 'b) -> 'a t -> 'b t
35val length : 'a t -> int
36val is_empty : 'a t -> bool
37val nth : 'a t -> int -> 'a
38val nth_opt : 'a t -> int -> 'a option
39val iter : ('a -> unit) -> 'a t -> unit
40val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
41
42(** {2 Comparison} *)
43
44val pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
45val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
46val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int