I'm new to Eliom and encounter The types of client values must be monomorphic from its usage or from its type annotation. This is the example I've got so far:
let%server new_entry_form =
let open Html.D in
let field = Raw.input ~a:[a_input_type `Text] () in
let submit = Raw.button ~a:[a_class ["button"]] [txt "add"] in
ignore
[%client
let open Html.D in
let open Js_of_ocaml_lwt.Lwt_js_events in
let field = Html.To_dom.of_input ~%field in
(Lwt.async @@ fun() ->
clicks (Html.To_dom.of_element ~%submit)
(fun _ _ ->
let entered = field##value |> Js_of_ocaml.Js.to_string in
add_entry {id="5";name=entered;description=""};
Lwt.return_unit):unit
)];
div [
field;submit
]
I'm guessing ~%field and ~%submit are the trouble. Why does this produce an error when it looks much like the tutorial code? Where have I gone wrong?