External Publication
Visit Post

Category transformers

Haskell Community [Unofficial] May 8, 2026
Source

Concisely: Many monad transformers are based on CatFunctors on Kleisli categories. Look at the type of Kleisli . mapM . runKleisli.

Should we stop using monads?

For a long time I believed that “lambda calculus enriched with effect E” would have semantics in the Kleisli category of E. But that can’t be true, since models of lambda calculus are cartesian closed categories and Kleisli categories are almost never cartesian closed. This hints at why Kleisli arrows might not be an ergonomic way to program. Instead, theoreticians painstakingly examine questions like “Is the cartesian closed sub-category C of D also closed under the monad E: D → D?”

I once tried using arrows for a model that used the RWST monad as effect, hoping that arrows would make documentation of data flow neater. But it turned out that do-notation is far more ergonomic in Haskell. For example, you can sprinkle let-bindigs and shared variables anywhere, have multi-parameter monadic functions, versus tedious funneling of data with (&&&) and (***).

Discussion in the ATmosphere

Loading comments...