A Practical Guide to Elixir Protocols
summary
Claims that Elixir protocols solve the expression problem by inserting a dispatch layer so new types can be added without changing existing functions and vice versa. Shows concrete tools: defprotocol/defimpl, fallback :any and @derive, inspects core protocols like String.Chars Collectable Inspect IEx.Info Enumerable and library uses such as Poison encoder/decoder and Scrivener paginate. Builds protocol implementations for structs and types and demonstrates they work at runtime on the BEAM.
AI-written summary · about
chapters (7)
- 0:00Intro
- 1:26Types and Functions
- 3:20ObjectOriented Style
- 15:13Expression Problem
- 17:48Core Protocols
- 25:59ThirdParty Integration
- 28:19Protocol vs Behavior
related talks
39mWhy Elixir Matters: A Genealogy of Functional Programming
39mFireside on making a typed language on the BEAM
52mKeynote
39mWhat if you could build production-ready RAG entirely in Elixir?
49mErlang Rationale
44mSome History of Functional Programming Languages
01h 13mDSPy: The End of Prompt Engineering
35mProof Theory Impressionism: Blurring the Curry-Howard Line
