Implicit parameters, when to use them (or not)!
summary
Implicits are presented as a concrete tool with rules not mystique: the compiler builds a type→value map, injects values from the current scope or companion objects, and errors on missing or ambiguous matches; use them for an environment pattern (per-request requester ID, clock injected to make tests deterministic) or a type class pattern (Json encoder constraints resolved via companion objects), prefer precise wrapper types and put common implicits in companion objects to keep behavior obvious.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:49Implicit parameters intimidating
- 2:30Explicit parameters and defaults
- 6:46Implicit parameters core
- 13:07Environment pattern
- 19:47Best practices for environment
- 23:40Type class pattern
- 34:21Best practices for type class
- 37:32Parameter styles summary
- 38:12Closing remarks
related talks
50mSharing Is Caring - How to Let the Compiler Know What You're Thinking
39mA few tips on modelling things in Scala
29mType Inference Techniques: Implementation and Formalization, Better Together
24mLet the Scala compiler work for you
43mThe Road to Kotlintown
42mSlow-Auto, Inconvenient-Semi: escaping false dichotomy with sanely-automatic derivation
39mJust Because You Can, Doesn't Mean You Should
46mCreating Internal DSLs in Kotlin
