HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleeffectful-core-2.7.1.2GHC2021

Effectful.Labeled.ReturnWith

Convenience functions for the Labeled ReturnWith effect.

Contents
  1. Effect
  2. Handlers
  3. Operations
  4. Re-exports
Synopsis

Effect

Handlers

Operations

Re-exports

newtypenewtype Labeled (label :: k) (e :: Effect) (a :: Type -> Type) b where

Assign a label to an effect.

Note: labeled effects are best used together with the effectful-plugin package, as it significantly improves their usability.

The constructor is for sending labeled operations of a dynamically dispatched effect to the handler:

Example1 expression
import Effectful.Dispatch.Dynamic
Example1 expression
:{  data X :: Effect where    X :: X m Int  type instance DispatchOf X = Dynamic:}
Example1 expression
:{  runPureEff . runLabeled @"x" (interpret_ $ \X -> pure 333) $ do    send $ Labeled @"x" X:}333

Constructors

Instances2DispatchOf, StaticRep