{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module Control.Effect.Trace
(
Trace(..)
, trace
, Algebra
, Has
, run
) where
import Control.Algebra
import Data.Kind (Type)
data Trace (m :: Type -> Type) k where
Trace :: { forall (m :: * -> *). Trace m () -> String
traceMessage :: String } -> Trace m ()
trace :: Has Trace sig m => String -> m ()
trace :: forall (sig :: (* -> *) -> * -> *) (m :: * -> *).
Has Trace sig m =>
String -> m ()
trace String
message = forall (eff :: (* -> *) -> * -> *) (sig :: (* -> *) -> * -> *)
(m :: * -> *) a.
(Member eff sig, Algebra sig m) =>
eff m a -> m a
send (forall (m :: * -> *). String -> Trace m ()
Trace String
message)
{-# INLINE trace #-}