Safe Haskell | None |
---|---|
Language | Haskell2010 |
Effect
newtype Tagged k e m a where Source #
An effect for annotating effects and disambiguating identical effects.
Actions
tag :: forall k e r a. Member (Tagged k e) r => Sem (e ': r) a -> Sem r a Source #
Tag uses of an effect, effectively gaining access to the tagged effect locally.
This may be used to create tagged-
variants of regular actions.
For example (the type applications aren't needed when using polysemy-plugin
):
taggedLocal :: forall k i r a .Member
(Tagged
k (Reader
i)) r => (i -> i) ->Sem
r a ->Sem
r a taggedLocal f m =tag
@k @(Reader
i) $local
@i f (raise
m)