[original issue 79 by @sgraf812]
In the last year, it has become increasingly clear that performant code needs to eta-expand state and reader monads. We have adopted a rather low-maintenance pattern synonym approach in GHC, documented in Note [The one-shot state monad trick]: https://gitlab.haskell.org/ghc/ghc/-/blob/ddbdec4128f0e6760c8c7a19344f2f2a7a3314bf/compiler/GHC/Utils/Monad.hs#L235.
It would be useful to have this trick in transformer, so that performance-aware users can eta-expand their types simply by taking advantage of newtype deriving.
[original issue 79 by @sgraf812]
In the last year, it has become increasingly clear that performant code needs to eta-expand state and reader monads. We have adopted a rather low-maintenance pattern synonym approach in GHC, documented in Note [The one-shot state monad trick]: https://gitlab.haskell.org/ghc/ghc/-/blob/ddbdec4128f0e6760c8c7a19344f2f2a7a3314bf/compiler/GHC/Utils/Monad.hs#L235.
It would be useful to have this trick in transformer, so that performance-aware users can eta-expand their types simply by taking advantage of newtype deriving.