|
|
|
|
|
by xixixao
3409 days ago
|
|
I'd say the problem isn't "this is not JSX", but that the syntax just looks awful: div []
[ div [] [ button [ onClick Increment ] [ text "+" ] ]
, div [] [ text <| toString model.counter ]
, div [] [ button [ onClick Decrement ] [ text "-" ] ]
]
JSX isn't the only syntax that took off, there are for example indentation based syntaxes for HTML, theoretically: div
div
button onClick: Increment
text "+"
div
text <| toString model.counter
div
button onClick: Decrement
text "-"
already much nicer (and if it was all wrapped in parens it wouldn't make much of a difference).Given that Elm is "just" for making HTML apps, this does seem like something the language should focus on. |
|
It turns out that it's less work to always have delimiters than it will be to have to add them anyways to disambiguate.