ducktape - Holding Scala's Productivity Together
summary
ducktape is a Scala 3, macro‑based library that materializes a Transformer typeclass to convert generated API case classes (OpenAPI/guardrail or smithy4s outputs) into domain types with one-line derives, handles enums and collections, and supports smart‑constructor routing via into/via. It wires refined/opaque newtypes into validation by generating accumulating mode or fail‑fast validations (Either or Option) and emits code that accumulates all field errors; the demo claims end‑to‑end validation and codegen work with no runtime failures.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:05JSON API development reality
- 3:35What is ducttape
- 5:01Transformer type class safety
- 6:04Case class transformations
- 7:50Enum transformations rules
- 9:16Mismatched case class fields
- 11:25Private constructors transformations
- 13:50Foldable transformers intro
- 17:19Configuring foldable transformers
- 18:42Fail-fast vs accumulating modes
- 22:57What are IDLs and OpenAPI
- 26:48API to domain model transforms
- 30:00Real endpoint example
- 32:30Live demo and closing
related talks
48mMetaprogramming in Dotty
43mIt quacks but it’s not a duck structural typing in Scala 3
48mTDD, Like in Type Driven Development
29mADVENTURES IN META-PROGRAMMING
42mAvoiding macros with inline and derived
53mTaming the context beast
42mScale By The Bay 2018 Unconference: Sergei Winitzki
59mMinimizing the Slippery Surface of Failure
