package melange-json
Compositional JSON encode/decode library and PPX for Melange, with native compatibility
Install
Dune Dependency
Authors
Maintainers
Sources
melange-json-1.2.0.tbz
sha256=080f34a2d6ce9c75ead1ba28264a102fe5326d09cb5347774d917bc52613b5f7
sha512=9308b09562eba762e3f61f82fcdaa49ca726868e3f411c2b944d35f1d9476584a7f3e0b60d7b1a5d2a53c66a39468a663ae410d93151c02d944dcea27eb12054
doc/src/melange-json.ppx-runtime-native/ppx_deriving_json_runtime.ml.html
Source file ppx_deriving_json_runtime.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
type t = Yojson.Basic.t let to_json t = t let of_json t = t let to_string t = Yojson.Basic.to_string t let of_string s = Yojson.Basic.from_string s exception Of_json_error of string let of_json_error msg = raise (Of_json_error msg) module To_json = struct let string_to_json v = `String v let bool_to_json v = `Bool v let int_to_json v = `Int v let float_to_json v = `Float v let unit_to_json () = `Null let list_to_json v_to_json vs = `List (List.map v_to_json vs) let option_to_json v_to_json = function | None -> `Null | Some v -> v_to_json v end module Of_json = struct let string_of_json = Yojson.Basic.Util.to_string let bool_of_json = Yojson.Basic.Util.to_bool let int_of_json = Yojson.Basic.Util.to_int let float_of_json = Yojson.Basic.Util.to_float let unit_of_json = function | `Null -> () | _ -> of_json_error "expected null" let option_of_json v_of_json = Yojson.Basic.Util.to_option v_of_json let list_of_json v_of_json json = List.map v_of_json (Yojson.Basic.Util.to_list json) end module Primitives = struct include To_json include Of_json end module Classify = struct let classify : t -> [ `Null | `String of string | `Float of float | `Int of int | `Bool of bool | `List of t list | `Assoc of (string * t) list ] = fun x -> x end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>