Write a predicate once and run it against SQL, MongoDB, Elasticsearch, or any backend. An introduction to criteria4s and its practical take on the Expression Problem.
Write a predicate once and run it against SQL, MongoDB, Elasticsearch, or any backend. An introduction to criteria4s and its practical take on the Expression Problem.
Every trait in your hexagonal architecture is a tagless-final algebra. Every impl is an interpreter. You have been writing denotational semantics without knowing it. We trace the connection from Kiselyov’s paper through Scala’s Cats-Effect to Rust’s port traits, and show why the pattern that academics call ‘finally tagless’ is the same pattern that practitioners call ‘dependency injection.’
Adding a new type is easy in OOP, hard in FP. Adding a new operation is easy in FP, hard in OOP. Philip Wadler named this the Expression Problem in 1998. We show how it manifests in Rust and Scala, and tease the resolution.