Deferring Type Errors to Runtime
From OO to Clojure Workshop!
Watch my free workshop to help you learn Clojure faster and shift your paradigm to functional.
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.[↩](#fnref1) 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.[↩](#fnref2)