Module type Acutis.DECODABLE

A specification for decoding and encoding input data.

type t
type 'a assoc

A key-value container such as an association list or a string map.

Decoding

val get_int : t -> int option
val get_string : t -> string option
val get_float : t -> float option
val get_bool : t -> bool option
val get_some : t -> t option
val get_seq : t -> t Stdlib.Seq.t option
val get_assoc : t -> t assoc option
val assoc_find : string -> 'a assoc -> 'a
val assoc_mem : string -> 'a assoc -> bool
val assoc_to_seq : 'a assoc -> (string * 'a) Stdlib.Seq.t

Encoding

val null : t
val some : t -> t
val of_float : float -> t
val of_string : string -> t
val of_bool : bool -> t
val of_int : int -> t
val of_seq : t Stdlib.Seq.t -> t
val of_seq_assoc : (string * t) Stdlib.Seq.t -> t

Debugging

val to_string : t -> string
val marshal : 'a -> t