The ReaderT Design Pattern
Summary
The ReaderT Design Pattern explains how to structure Haskell applications around a single ReaderT Env IO, avoiding global mutable state and deep transformer stacks. It argues that mutable references can be used safely under ReaderT and monad-unlift, while WriterT, StateT and ExceptT can introduce concurrency and exception handling complexity. The article also explores Has typeclasses to improve modularity and testability and discusses practical trade offs between purity and practicality.