This guide assumes at least some prior knowledge of dynamically-typed languages. The idea of this guide is to help make a mental shift from dynamic to static types.
If you have prior knowledge of statically typed languages, but Hindley-Milner doesn't ring a bell for you, this guide can be useful for you too.
This is my diary of personal discoveries. I find myself explaining those things again and again to different people. I decided to write it down once and for all.
Table of contents
- Exhaustive check and why it is useful for event processing, enums, unions or disjoint unions
- Opaque types and how they could have saved Mars Climate Orbiter
- IO validation or how to handle JSON-based APIs in statically typed language
- What are types?
- Dynamically-, statically-, gradually-, weakly-, strongly- and un-typed languages
- Type system vs null
- Making Impossible States Impossible
- Immutability and type system
- Classes, types, sets, structural and nominal subtyping, Liskov substitution principle
- Redux and impossible states
- Redux and impossible state transitions or FSM
- Redux and side effects
- Types and proofs
- Terminology: soundness, completeness, totality, decidability
- Rosetta stone, Curry–Howard correspondence
- To be continued...
- Types, and Why You Should Care
- Lauren Tan Swipe Left, Uncaught TypeError Learning to Love Type Systems
Ideas, questions, and fixes are welcome. Sharing on social networks is also a big help. Thank you.