The Robustness Principle Is Not Robust

Hadn't seen this...

It starts from the premise of "you can't write [a] -> a", which is where I had wanted to start my own Intro-to-Haskell essay. Grasping how nothing is taken for granted (no default constructor, etc) and how the type signature practically tells you what the function does.

Now I don't have to write my own less-informed version of that. :relieved:

(Although it does expect you to know what head :: [a] -> a means, and I'd thought of really starting from no knowledge besides familiarity with some imperative language for contrast.)


I don't see anything to disagree with:

  • "Use a data structure that makes illegal states unrepresentable."

  • "Get your data into the most precise representation you need as quickly as you can. Ideally, this should happen at the boundary of your system, before any of the data is acted upon."

  • "Avoid denormalized representations of data, especially if it’s mutable."

  • "Keep denormalized representations of data behind abstraction boundaries."

This kind of thinking is what made me want TEXT! to work how it does enforcing UTF-8, and is guiding thinking on pushing that further to NFC.