I have an array in JavaScript which contains different types of values:
[1, "abc", bool, 2, "efg", false, ... ]
I want to pass this array to an OCaml program by Js_of_ocaml. Because all the elements of an array in OCaml must have the same type. I don't know where (on the JS side or OCaml side?) and how to make this conversion.
Should I add type information to array elements on the JS side? I guess we need to build finally a variant type on the OCaml side?
Could anyone tell me what's the best way to realise this?
