Thanks for writing this! You're so concise - you explain concepts in one sentence, where 100 are possible because of the depth of the topic. That takes great restraint!
Very nicely organised too.
Some typos and suggestions:
This property, of behind able to substitute the two sides of the equals sign with one another, is called referential transparency. And it is pretty unique to Haskell (and a few language that are very similar to it like PureScript and Elm)!
anonymous functions are also known as lambda functions.
Hopefully this form makes it a bit clearer why Haskell functions always take one argument and return another,...
..."and return another function"
Editorial: If we're not using lambda functions here, maybe move this section to where they are used?
Right out of the batRight off the bat
Editorial: You could make the DSL/EDSL section much shorter if you wanted.
The right-hand side of the newtype declaration describes how an expression of that type looks~~ like~~.
type, on the other hand, A type is just a name alias.
Back to newtypes.
Editorial: Why not just move the type
section so this paragraph is right after where you introduce newtype
?
Then the multiple patterns of a case expression will make more sense.
Editorial: Why include case
statements here at all then? The pattern matching in function definitions is good for introducing the concept.
getStructureString :: Structure -> String
Oops! Structure
has not been defined. Did you change from calling it Html
to Structure
?
p_ = Structure . el "p"
Ooo! What's this? Composing a constructor with one of our functions? Neat! You did mention that constructors were like functions, but the reader didn't know you could actually compose them. What's the effect here? (do you like the word 'wrap' for this?)
Thanks again for the content... still reading!