HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulepolysemy-1.9.2.0Haskell2010

Polysemy.Tagged

  • 1 type
  • 4 values
  • Packagepolysemy-1.9.2.0
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTagged.hs

Effect

1 declaration
newtypenewtype Tagged (k3 :: k) (e :: k1 -> k2 -> Type) (m :: k1) (a :: k2) where
#

An effect for annotating effects and disambiguating identical effects.

Constructors

Actions

2 declarations
valuetag :: Member (Tagged k2 e) r => Sem (e ': r) a -> Sem r a
#

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:

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)

Interpretations

2 declarations