I have a list of tags:
let tags = ["div", "h1", "p"]
Can I generate a module which contains functions with those tags as names?
/* don't mind the syntax, it's Facebook's Reason (new interface to ocaml) */
let module DOM = {
let div props children => Js.Unsafe.fun_call
(Js.Unsafe.get dom (Js.string "div")) [|Js.Unsafe.inject props, Js.Unsafe.inject children|];
let h1 props children => Js.Unsafe.fun_call
(Js.Unsafe.get dom (Js.string "h1")) [|Js.Unsafe.inject props, Js.Unsafe.inject children|];
let p props children => Js.Unsafe.fun_call
(Js.Unsafe.get dom (Js.string "p")) [|Js.Unsafe.inject props, Js.Unsafe.inject children|];
}
The tag name should become a function in the module... Is this possible?