HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulepolysemy-1.9.2.0Haskell2010

Polysemy.Internal.Strategy

  • 3 types
  • 7 values
  • Packagepolysemy-1.9.2.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceStrategy.hs
valuegetInspectorS :: Sem (WithStrategy m f n) (Inspector f)
#

Get a natural transformation capable of potentially inspecting values inside of f. Binding the result of getInspectorS produces a function that can sometimes peek inside values returned by bindS.

This is often useful for running callback functions that are not managed by polysemy code.

See also getInspectorT

valueliftS :: Functor m => m a -> Strategic m n a
#

Lifts an action of the final monad into Strategic.

Note: you don't need to use this function if you already have a monadic action with the functorial state threaded into it, by the use of runS or bindS. In these cases, you need only use pure to embed the action into the Strategic environment.

valuerunS :: n a -> Sem (WithStrategy m f n) (m (f a))
#

Lifts a monadic action into the stateful environment, in terms of the final monad. The stateful environment will be the same as the one that the Strategy is initially run in.

Use bindS if you'd prefer to explicitly manage your stateful environment.

valuebindS :: (a -> n b) -> Sem (WithStrategy m f n) (f a -> m (f b))
#

Embed a kleisli action into the stateful environment, in terms of the final monad. You can use bindS to get an effect parameter of the form a -> n b into something that can be used after calling runS on an effect parameter n a.