package ppx_deriving_yamlx

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file ppx_deriving_yamlx_runtime.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type t = YAMLx.value
type integer = int64

let int i = YAMLx.Int (YAMLx.zero_loc, Int64.of_int i)
let float f = YAMLx.Float (YAMLx.zero_loc, f)
let string s = YAMLx.String (YAMLx.zero_loc, s)
let bool b = YAMLx.Bool (YAMLx.zero_loc, b)
let list l = YAMLx.Seq (YAMLx.zero_loc, l)

let obj b =
  let assoc = List.map (fun (s, v) -> (YAMLx.zero_loc, string s, v)) b in
  YAMLx.Map (YAMLx.zero_loc, assoc)

let null = YAMLx.Null YAMLx.zero_loc
let of_integer i64 = Int64.to_int i64