runIgnoringTrace

This commit is contained in:
Sandy Maguire 2019-04-02 16:07:25 -04:00
parent 6e11e06f30
commit f17ad3fc66

View File

@ -20,6 +20,12 @@ runTraceIO = interpret $ \case
{-# INLINE runTraceIO #-}
runIgnoringTrace :: Member (Lift IO) r => Semantic (Trace ': r) a -> Semantic r a
runIgnoringTrace = interpret $ \case
Trace _ k -> pure k
{-# INLINE runIgnoringTrace #-}
runTraceAsOutput :: Semantic (Trace ': r) a -> Semantic (Output String ': r) a
runTraceAsOutput = reinterpret $ \case
Trace m k -> output m >> pure k