Deferring Type Errors to Runtime

Eric Normand's Newsletter
Software design, functional programming, and software engineering practices
Over 5,000 subscribers

Reference: Deferring Type Errors to Runtime

Haskell just got a whole lot more useful for prototyping. One of my biggest gripes with Haskell was how much code had to be changed if a single type was altered^1, since the compiler was always looking for consistent types. There were ways to work around it^2, but they were always tedious and unsatisfactory.

This new development in 7.6 lets you compile and run the code, changing type signatures many times, before you have to propagate the change through the rest of the code.


This is the classical definition of tight coupling. That's right:
static typing introduces coupling.



How to do it? Never change a type signature. Instead, create a new
name with the same value, and modify that. Then, when it has settled
into its permanent type signature, rename it to the old name,
recompile, and let the error messages guide you.
Sean Allen
Sean Allen
Your friendly reminder that if you aren't reading Eric's newsletter, you are missing out…
👍 ❤️
Nicolas Hery
Nicolas Hery
Lots of great content in the latest newsletter! Really glad I subscribed. Thanks, Eric, for your work.
👍 ❤️
Mathieu Gagnon
Mathieu Gagnon
Eric's newsletter is so simply great. Love it!
👍 ❤️