{-# 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 :: { Trace m () -> String
traceMessage :: String } -> Trace m ()
trace :: Has Trace sig m => String -> m ()
trace :: String -> m ()
trace String
message = Trace m () -> m ()
forall (eff :: (* -> *) -> * -> *) (sig :: (* -> *) -> * -> *)
(m :: * -> *) a.
(Member eff sig, Algebra sig m) =>
eff m a -> m a
send (String -> Trace m ()
forall (m :: * -> *). String -> Trace m ()
Trace String
message)
{-# INLINE trace #-}