Using Semantic Types to Squash Bugs
summary
Elm code converts a bug about masked social security numbers into a compiler-guided refactor: primitives become a wrapper type SSNInput, JSON decoders and input handlers wrap early, display and external ports unwrap late, and the module hides the constructor as an opaque type. Live coding replaces ad hoc string flow with typed entry points and explicit terminal unwrapping, so the compiler forces fixes where masking, submission, or URL building must use the correct semantic form.
AI-written summary · about
chapters (8)
- 0:00Start
- 0:33Using Semantic Types to Squash Bugs
- 2:21Elm Architecture
- 11:21Guard Our Logic
- 13:01Application Flow
- 16:36Introducing a Wrapper Type
- 22:09Compiler Errors
- 24:20Using Json Decode Map
related talks
25mMaking Impossible States Impossible
30mElm the Game Changer
23mGetting rid of runtime errors with Elm
39mDeveloper Happiness on the Front End with Elm
56mSimplifying Web App Development With Elm and Functional Programming
38mConfident Frontend with Elm
21mBeyond Type Checking Building Bulletproof TypseScript Applications
48mHighway to Elm!
