Category transformers
Haskell Community [Unofficial]
May 8, 2026
olf:
Should we stop using monads?
Counter-counterpoint: why are monad cakes even viewed as a good foundation?
The example in this article could be naively written as
isEnvGreaterThanInput :: Handle -> Int -> IO (Maybe Bool)
isEnvGreaterThanInput handle env = do
input <- hGetLine handle
case readMaybe input of
Nothing -> pure Nothing
Just n -> pure $ Just (env > n)
It’s shorter than the other two versions, it doesn’t do magic (can’t read from a Handle if it was never passed to you), and it trivially composes with any other plain IO function.
Discussion in the ATmosphere