haskell / haskell/transformers
Offer `Eta*` versions of function-represented `ReaderT`, `StateT`, etc. that use `GHC.Exts.oneShot`
Open
- Dominant language
- Haskell
- Stars
- 5
- Forks
- 10
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 1
Description
[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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.