Take this chunk of code as an example:
makeRectangle answer =
div
[ Html.Attributes.style "width" "140px"
, Html.Attributes.style "height" "100px"
, Html.Attributes.style "margin-top" "10px"
, Html.Attributes.style "padding-top" "5px"
, Html.Attributes.style "padding-left" "5px"
, Html.Attributes.style "background-color" (getColor (Tuple.second answer))
, Html.Attributes.style "border" "2px solid black"
]
[ button [ onClick (SetCorrect (Tuple.first answer)) ] [ Html.text "Yes" ]
, Html.text " "
, button [ onClick (SetIncorrect (Tuple.first answer)) ] [ Html.text "No" ]
, Html.text " "
, button [ onClick (SetUnread (Tuple.first answer)) ] [ Html.text "Reset" ]
]
It's really hard to see what is what, without really digging into it, and everything is repeated everywhere for maximum explicitness (thanks types?). Why is `Html.Attributes.style` and `HTML.text` repeated so many times when it's just style declaration for one thing and of course a string would be Html.text, what else could it be? It seems so verbose.But then my benchmark for expressiveness would probably be Clojure (ClojureScript in this case [Reagent]), and it would look like this:
(defn make-rectangle [answer]
[:div
{:style {:width "140px"
:height "100px"
:margin-top "10px"
:padding-top "5px"
:padding-left "5px"
:background-color (get-color (second answer))
:border "2px solid black"}}
[:button {:onClick (set-correct (first answer))}
"Yes"]
[:button {:onClick (set-correct (first answer))}
"No"]
[:button {:onClick (set-unread (first answer))}
"Reset"]])
Same amount of lines as Elm example, but things have room to breath. It's clear what belongs to what based on the indentation.