TypeCheck Effortless Runtime Type Checking
summary
TypeCheck is an Elixir library that compiles existing @specs into runtime wrappers that validate inputs and outputs, emit readable nested error traces, and still keep original specs for Dialyzer. It also auto-generates spec tests as property-based tests (uses StreamData) to expose edge cases like divide-by-zero. Metaprogramming inlines checks for performance (test suite sees ~30% speedup on OTP 25), checks scale with input size, and can be toggled per app/module/env.
AI-written summary · about
chapters (6)
- 0:0002:31 - Intro
- 2:3213:10 - What is Typechecking and What is a Type?
- 13:1121:23 - The Contract of a Function
- 21:2424:36 - How Readable are the Error Messages?
- 24:3731:54 - Advanced Features
- 31:5536:13 - Conclusion & QnA
related talks
10mLightning talk: Typechecking Elixir
49mDialyzer: Optimistic Type Checking for Erlang and Elixir
20mType-level Property Based Testing
41mQuickCheck Mini for Elixir
47mTesting the Hard Stuff and Staying Sane
29mSame same but different: A Comparative Analysis of Static Type Checkers in Erlang
38mChemanalysis: Dialyzing Elixir
23mProperty based testing is a mindset
