HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

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

Modulecontra-tracer-0.2.1.1Haskell2010

Control.Tracer.Arrow

  • 1 type
  • 6 values
datadata TracerA (m :: Type -> Type) a b where
#

Formal representation of a tracer arrow as a Kleisli arrow over some monad, but tagged so that we know whether it has any effects which will emit a trace.

Constructors

  • Emitting :: Kleisli m a x -> Kleisli m x b -> TracerA m a b

    An emitting part, followed by a non-emitting part. The non-emitting part is there so that later emitting parts can be tacked-on later.

  • Squelching :: Kleisli m a b -> TracerA m a b

    No emitting. There may be side-effects, but they are assumed to be benign and will be discarded by runTracerA.

Instances3Category, Arrow, ArrowChoice
valuerunTracerA :: Monad m => TracerA m a () -> Kleisli m a ()
#

The resulting Kleisli arrow includes all of the effects required to do the emitting part.

valueemit :: Applicative m => (a -> m ()) -> TracerA m a ()
#

Do an emitting effect. Contrast with effect which does not make the tracer an emitting tracer.

valueeffect :: (a -> m b) -> TracerA m a b
#

Do a non-emitting effect. This effect will only be run if some part of the tracer downstream emits (see emit).

valuesquelch :: Applicative m => TracerA m a ()
#

Ignore the input and do not emit. The name is intended to lead to clear and suggestive arrow expressions.

valuenat :: (forall x. m x -> n x) -> TracerA m a b -> TracerA n a b
#

Use a natural transformation to change the underlying monad.