What’s so bad about Template Haskell?

It seems that Template Haskell is often viewed by the Haskell community as an unfortunate convenience. It’s hard to put into words exactly what I have observed in this regard, but consider these few examples Template Haskell listed under “The Ugly (but necessary)” in response to the question Which Haskell (GHC) extensions should users use/avoid? … Read more

Abusing the algebra of algebraic data types – why does this work?

The ‘algebraic’ expression for algebraic data types looks very suggestive to someone with a background in mathematics. Let me try to explain what I mean. Having defined the basic types Product • Union + Singleton X Unit 1 and using the shorthand X² for X•X and 2X for X+X et cetera, we can then define … Read more

What is Weak Head Normal Form?

What does Weak Head Normal Form (WHNF) mean? What does Head Normal form (HNF) and Normal Form (NF) mean? Real World Haskell states: The familiar seq function evaluates an expression to what we call head normal form (abbreviated HNF). It stops once it reaches the outermost constructor (the “head”). This is distinct from normal form (NF), in which an expression is … Read more

Good Haskell source to read and learn from [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more