Let's derive HTTP clients from types
summary
Claim: you can derive your HTTP client function from a single type. Implementation details: represent endpoints as literal singleton types, use shapeless witness and HList to build a type‑level API, then run recursive implicit resolution (lazy implicits) to fold into a request structure. Result: a derived function for HTTP4s returning IO[List[User]] that actually works. Caveats: compilation can blow up — uploader reports exponential compile times up to hours — code and a library exist but need performance tuning.
AI-written summary · about
chapters (14)
- 0:00Intro
- 2:15Summary
- 4:01Benefits and Cost
- 5:48About me
- 12:00API type
- 19:33Derivation
- 29:45Implicit Resolution
- 31:02Data Collection
- 31:58Return Case
- 34:41Putting it all together
- 36:38Derived
- 38:28Two takeaways
- 39:21A shameless plug
- 40:58Questions
related talks
45mA Server is Just a Function An Introduction to http4s
33mYour HTTP endpoints are data, as well!
23mOBJECT ALGEBRAS AND WHY YOU WON'T TOUCH HTTP LIBRARY EVER AGAIN
01h 01mThe Shape(less) of Type Class Derivation in Scala 3
25mForget HTTP
24mServant: Web APIs at the Type Level
57mKittens: Shapeless Typeclass Derivation for Cats
42mEvolving Your HTTP APIs, a Step-by-Step Approach
