| Copyright | (c) Alexander Vieth 2019 |
|---|---|
| License | Apache-2.0 |
| Maintainer | aovieth@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Control.Tracer.Arrow
Description
Synopsis
- data TracerA (m :: Type -> Type) a b where
- runTracerA :: forall (m :: Type -> Type) a. Monad m => TracerA m a () -> Kleisli m a ()
- compute :: forall (m :: Type -> Type) a b. Applicative m => (a -> b) -> TracerA m a b
- emit :: Applicative m => (a -> m ()) -> TracerA m a ()
- effect :: (a -> m b) -> TracerA m a b
- squelch :: forall (m :: Type -> Type) a. Applicative m => TracerA m a ()
- nat :: (forall x. m x -> n x) -> TracerA m a b -> TracerA n a b
Documentation
data TracerA (m :: Type -> Type) a b where Source #
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 :: forall (m :: Type -> Type) a x b. 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 :: forall (m :: Type -> Type) a b. 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 :: forall (m :: Type -> Type) a. Monad m => TracerA m a () -> Kleisli m a () Source #
The resulting Kleisli arrow includes all of the effects required to do the emitting part.
compute :: forall (m :: Type -> Type) a b. Applicative m => (a -> b) -> TracerA m a b Source #
Pure computation in a tracer: no side effects or emits.
emit :: Applicative m => (a -> m ()) -> TracerA m a () Source #
Do an emitting effect. Contrast with effect which does not make the
tracer an emitting tracer.
effect :: (a -> m b) -> TracerA m a b Source #
Do a non-emitting effect. This effect will only be run if some part of
the tracer downstream emits (see emit).