Contextual: Enhancing Scala with Your Own Compile-time Checks
summary
Contextual is an open-source Scala library that makes interpolated strings subject to compile-time interpolation checks by running a macro that validates literal parts and maps holes to contexts; it provides a runtime evaluate step, type-class based embeddings, and extension points. Concrete checks include URL parsing, CSS and XML validity, file/classpath existence, and spelling, and failures surface as compiler errors with cursor offsets. Current release is 1.0.1 (escapes via user typeclasses) and v2.0 moves escaping into the interpolator itself.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 3:03Interpolators
- 4:21Scala Compiler
- 8:40String Context
- 14:55Recap
- 19:22Classpaths
- 20:44Basic Expressions
- 21:53Number Failing
- 27:01XML
- 31:42Context is important
- 33:06escaping
- 36:08record
- 40:13seven steps
- 41:36create interpolator
- 42:26staticinterpolator
- 43:42staticinterpolator example
- 45:33interpolator example
- 46:23filtrate
- 47:46evaluate
- 50:12URL encoding
- 51:06varargs
- 52:05strings
- 55:53summary
- 56:53conclusion








