package ocf
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Ocf.Wrapper
type 'a t = {to_json : ?with_doc:bool -> 'a -> Yojson.Safe.t;from_json : ?def:'a -> Yojson.Safe.t -> 'a;
}val make :
(?with_doc:bool -> 'a -> Yojson.Safe.t) ->
(?def:'a -> Yojson.Safe.t -> 'a) ->
'a tval of_ok_error :
(Yojson.Safe.t -> [ `Ok of 'a | `Error of 'b ]) ->
Yojson.Safe.t ->
'aof_ok_error f json applies f to json. If it returns `Ok x, then x is returned. Else invalid_value is called with the given json. This function is useful to wrap *_of_yojson functions generated by ppx_deriving_yojson.
val json : Yojson.Safe.t tval int : int tval float : float tval bool : bool tval string : string tval string_ : ('a -> string) -> (string -> 'a) -> 'a ttype assocs = (string * Yojson.Safe.t) listval string_map :
fold:((string -> 'a -> assocs -> assocs) -> 'map -> assocs -> assocs) ->
add:(string -> 'a -> 'map -> 'map) ->
empty:'map ->
'a t ->
'map tTo create a map from strings to 'a. This will be stored in JSON as
{ foo: ..., bar: ..., ... } Here foo and bar are the keys in the resulting map. The Map.S.fold, Map.S.add and Map.S.empty functions can be used for parameters fold, add and empty.