Skip to main content

Cats-Effect

Tagless Final is denotational semantics in disguise

·10 mins
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.’