source: code/trunk/src/confix/confixToml.ml@ 1

Last change on this file since 1 was 1, checked in by fox, 9 years ago

initial simple example with omd

File size: 691 bytes
RevLine 
[1]1type t = TomlTypes.table
2
3let from_path path =
4 match Toml.Parser.from_filename (Fpath.to_string path) with
5 | `Error (str, _loc) -> Error str
6 | `Ok toml -> Ok toml
7
8open TomlLenses
9let (/) a b = (key a |-- table |-- key b)
10let (//) a b = (key a |-- table |-- key b |-- table)
11
12let int toml path = get toml (path |-- int)
13
14let float toml path = get toml (path |-- float)
15
16let string toml path = get toml (path |-- string)
17
18let strings toml path = get toml (path |-- array |-- strings)
19
20let path toml path = match string toml path with Some s -> Some (Fpath.v s) | None -> None
21
22let paths toml path = match strings toml path with
23 Some ss -> Some (List.map Fpath.v ss) | None -> None
Note: See TracBrowser for help on using the repository browser.