Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Commit

Permalink
Trace to stderr by default
Browse files Browse the repository at this point in the history
  • Loading branch information
xkollar committed May 11, 2017
1 parent 677aeb3 commit cf4b479
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Control/Monad/Freer/Trace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Control.Monad ((>>=), return)
import Data.Either (Either(Left, Right))
import Data.Function ((.), const)
import Data.String (String)
import System.IO (IO, putStrLn)
import System.IO (IO, hPutStrLn, stderr)

import Control.Monad.Freer.Internal
(Eff(E, Val), Member, decomp, qApp, send, tsingleton)
Expand All @@ -68,7 +68,7 @@ runTrace f (E u q) = case decomp u of

-- | Simple handler for 'Trace' 'String' that just writes it to stdout.
runTraceIO :: Member IO effs => Eff (Trace String ': effs) a -> Eff effs a
runTraceIO = runTrace (send . putStrLn)
runTraceIO = runTrace (send . hPutStrLn stderr)

-- | Ignore traces.
runTraceSilent
Expand Down

0 comments on commit cf4b479

Please sign in to comment.