A Field Guide to DSL Design
summary
Summarizes practical rules and a working example DSL for data assertions in Scala: builds an imperative, eagerly evaluated mini-language that uses infix/dot syntax, implicit classes to add a should/should be API, contravariant Predicate[T] types, and a sealed trait predicate hierarchy to separate modal vs compound predicates. Covers concrete workarounds—parentheses for chaining, an overload to handle null, implicit lifts for true/false, and adding negative failure messages for negation—and links to GitHub with the actual code that compiles and runs.
AI-written summary · about
chapters (7)
- 0:00Start
- 5:54Examples
- 15:19Mode
- 23:21Implicit Classes
- 25:10Foundation
- 31:32Parameterization
- 37:21Negation
related talks
01h 04mWhat FP Can Learn From Formal Languages: Towards a Leaner Syntax
46mWriting a DSL (Domain Specific Language) for PowerShell
50mDomain Driven Design and Onion Architecture in Scala
01h 00mDesign Idioms from an Alternate Universe
01h 44mPractical Observable Sharing
56mPrinciples of Elegance
40mDesigning Function Families and Bundles with Java's Behaviours Parameterization and Lambdas
52mDomain Modeling Made Functional
