Hi. I'm working my way around Lustre (and gosh is it awesome!). I'm new to Gleam (and statically typed languages in general - though I've several years of Elixir/BEAM) and I'm struggling to understand the following return signature....
fn view(model: Model) -> Element(Msg) {
let count = int.to_string(model.count)
html.div([], [
html.button([event.on_click(UserClickedIncrement)], [html.text("+")]),
html.p([], [html.text(count)]),
html.button([event.on_click(UserClickedDecrement)], [html.text("-")]),
])
I know MSG is one of my message types e.g. UserClickedIncrement but I can't tie Element(Msg) to what I believe is a chunk of HTML. I'm obviously missing something.
Could someone help explain this or point me to somewhere on the Web that might explain it.
Many thanks