HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleeffectful-core-2.7.1.2GHC2021

Effectful.Labeled.Provider

Convenience functions for the Labeled Provider effect.

  • 3 types
  • 6 values

Effect

2 declarations
datadata Provider (e :: Effect) input (f :: Type -> Type) (a :: Type -> Type) b where
#

Provide a way to run a handler of e with a given input.

Note: f can be used to alter the return type of the effect handler. If that's unnecessary, use Provider_.

Constructors

  • ProvideWith :: input -> Eff (e ': es) a -> Provider e input f a (f a)

    Run the effect handler with a given input.

Instances1DispatchOf

Handlers

Operations

Re-exports

1 declaration
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