From 3a63052f4f6156e8615423ea43d2bfe7780752e3 Mon Sep 17 00:00:00 2001 From: Juan Paucar Date: Mon, 2 Dec 2019 06:19:55 -0500 Subject: [PATCH] Update outputToTrace definition (#289) --- src/Polysemy/Trace.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Polysemy/Trace.hs b/src/Polysemy/Trace.hs index db38474..28b19f6 100644 --- a/src/Polysemy/Trace.hs +++ b/src/Polysemy/Trace.hs @@ -77,16 +77,16 @@ runTraceList = runOutputList . reinterpret ( ------------------------------------------------------------------------------ --- | Transform an 'Output' 'String' effect into a 'Trace' effect. +-- | Transform an @'Output' w@ effect into a 'Trace' effect given a function +-- to transform each @w@ to a 'String'. -- -- @since 1.0.0.0 outputToTrace - :: ( Show w - , Member Trace r - ) - => Sem (Output w ': r) a - -> Sem r a -outputToTrace = interpret $ \case - Output m -> trace $ show m + :: Member Trace r + => (w -> String) + -> Sem (Output w ': r) a + -> Sem r a +outputToTrace show' = interpret $ \case + Output m -> trace $ show' m {-# INLINE outputToTrace #-}