struct
type t = {
name: string;
parameters: (string * string) list
}
let to_json {name; parameters}: Yojson.Basic.json =
`Assoc [
"name", `String name;
"parameters",
`Assoc (List.map parameters ~f:(fun (a, b) -> a, `String b));
]
let render {parameters; _} =
List.concat_map parameters ~f:(fun (a,b) -> [a; b])
let default =
{name = "default"; parameters = []}
let example_1 =
(* The first one: http://sourceforge.net/p/virmid/wiki/Home/#examples *)
{name= "examplel_1";
parameters = [
"-c1", "20";
"-C1", "100";
"-c2", "20";
"-C2", "100";
]}
let name t = t.name
end