Module Utils.Prelude

Most-used helper functions, Stdlib extensions

val pp_option : 'a Fmt.t -> 'a option Fmt.t

Option pretty-printer

val pp_list : ?sep:unit Fmt.t -> 'a Fmt.t -> 'a list Fmt.t

List pretty-printer

val of_yojson_string : (Yojson.Safe.t -> ('a, 'b) Stdlib.result) -> string -> 'a

Given an of_yojson function, converts a string to the desired type

module Hashtbl : sig ... end

Extension of Hashtbl with functions to serialize to and deserialize from yojson, along with some other helpers

module Map : sig ... end

Extension of Map with functions to serialize to and deserialize from yojson

module Hashset : sig ... end

Represents a set of values, with no duplicates

module Stack : sig ... end

Extension of Stack with functions to serialize to and deserialize from yojson

module SN = Containers.SN
module Syntaxes = Syntaxes
val opt_to_yojson : ('a -> Yojson.Safe.t) -> 'a option -> Yojson.Safe.t

Converts an Option to yojson

val list_to_yojson : ('a -> Yojson.Safe.t) -> 'a list -> [> `List of Yojson.Safe.t list ]

Converts a list of values to yojson