If you see this, and you like it: Elm's HTML DSL is similar, and really nice.
Every HTML tag (except for `text`) is an implementation of the base function `node`, which is:
node : String -> List Attr msg -> List Html msg -> Html msg
So in the base library, the `p` tag is implemented as
p : List Attr msg -> List Html msg -> Html msg
p = node "p"
Which means that in Elm, the above content would look like this:
p [] [ text "Hello ", b [] [ text "World" ] ]
i.e., every HTML tag can accept as parameters:
- A list of attributes
- A list of child tags
I've found it to be very elegant to work with; and with a good auto-formatter, it's really easy to build complicated HTML without losing your place and dropping a closing tag.