Skip to content

Offer Eta* versions of function-represented ReaderT, StateT, etc. that use GHC.Exts.oneShot #84

@sjshuck

Description

@sjshuck

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions