Pure OCaml Yaml 1.2 reader and writer using Bytesrw
at main 1.3 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** YAML tags for type information *) 7 8type t = { 9 handle : string; (** e.g., "!" or "!!" or "!foo!" *) 10 suffix : string; (** e.g., "str", "int", "custom/type" *) 11} 12 13val make : handle:string -> suffix:string -> t 14(** Create a tag from handle and suffix *) 15 16val of_string : string -> t option 17(** Parse a tag string *) 18 19val to_string : t -> string 20(** Convert tag to string representation *) 21 22val to_uri : t -> string 23(** Convert tag to full URI representation *) 24 25val pp : Format.formatter -> t -> unit 26(** Pretty-print a tag *) 27 28val equal : t -> t -> bool 29(** Test equality of two tags *) 30 31val compare : t -> t -> int 32(** Compare two tags *) 33 34(** {2 Standard Tags} *) 35 36val null : t 37val bool : t 38val int : t 39val float : t 40val str : t 41val seq : t 42val map : t 43val binary : t 44val timestamp : t 45 46(** {2 Tag Predicates} *) 47 48val is_null : t -> bool 49val is_bool : t -> bool 50val is_int : t -> bool 51val is_float : t -> bool 52val is_str : t -> bool 53val is_seq : t -> bool 54val is_map : t -> bool