Skip to content

Commit

Permalink
Use contramap to simplify nested tracing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Aug 20, 2020
1 parent bf90817 commit cb87439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core/src/Cardano/Pool/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import Control.Monad.IO.Class
import Control.Monad.Trans.Except
( ExceptT (..) )
import Control.Tracer
( Tracer (..), traceWith )
( Tracer, contramap, traceWith )
import Data.Either
( rights )
import Data.Generics.Internal.VL.Lens
Expand Down Expand Up @@ -183,7 +183,7 @@ newDBLayer trace fp timeInterpreter = do
let io = startSqliteBackend
(migrateManually trace)
migrateAll
(Tracer $ traceWith trace . MsgGeneric)
(contramap MsgGeneric trace)
fp
ctx@SqliteContext{runQuery} <- handlingPersistError trace fp io
return (ctx, DBLayer
Expand Down

0 comments on commit cb87439

Please sign in to comment.