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.WrapperSource
Source
type 'a t = {to_json : ?with_doc:bool -> 'a -> Yojson.Safe.t;from_json : ?def:'a -> Yojson.Safe.t -> 'a;
}Source
val make :
(?with_doc:bool -> 'a -> Yojson.Safe.t) ->
(?def:'a -> Yojson.Safe.t -> 'a) ->
'a tof_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.
Source
val 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.