Reading Notes

Brief thoughts and notes for reading the book Practical Haskell: A Real World Guide to Programming.

Chapter 14

The chapter first dives into attribute grammer by introducing various tools and focuses on a code generator named UUAGC. I skimmed through this part since it’s not really about Haskell but about a Haskell generator that has a syntax resembling the Haskell syntax. To be honest, it’s a bit weird to see a code generator introduction in a language introduction book. I can write A Python generator equipped with a Python-like syntax, but I wouldn’t recommend others to discuss it in a Python language introduction. A compiler or programming language design course would be more appropriate.

After the introduction of attribute grammer, the book goes through a generalized version of fold, also known as catamorphisms by mathematicians in category-theory. The term \(D\)-algebra is also defined. It’s a tuple of all the functions that are needed to perform a fold on a data structure. Lastly, unfold is another term for anamorphism. The core idea of generalized fold is replacing data constructors with a different function that evaluates to (more) concrete values.

Lastly, it briefly introduces data type-generic programming. As recognized by the author, the presentation is short and is only meant to give a taste on what it’s. Other more in-depth material is needed for better understanding.