Skip to content

Commit

Permalink
Merge pull request #26 from dpwiz/tracer
Browse files Browse the repository at this point in the history
Add Shower.Trace wrappers
  • Loading branch information
kana-sama authored Aug 21, 2024
2 parents 00ce8ae + 6eec241 commit 2a61cf7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions lib/Shower/Trace.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- | Wrappers for Debug.Trace functions with a nicer layout.

module Shower.Trace
( traceShower,
traceShowerId,
traceShowerWith,
traceShowerM
) where

import Debug.Trace
import Shower (shower)

traceShower :: Show a => a -> b -> b
traceShower = trace . shower

traceShowerId :: Show a => a -> a
traceShowerId x = trace (shower x) x

traceShowerWith :: Show b => (a -> b) -> a -> a
traceShowerWith f x = trace (shower $ f x) x

traceShowerM :: (Show a, Monad m) => a -> m ()
traceShowerM = traceM . shower
3 changes: 2 additions & 1 deletion shower.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shower
version: 0.2.0.3
version: 0.2.0.4
synopsis: Clean up the formatting of 'show' output
-- description:
license: BSD3
Expand All @@ -24,6 +24,7 @@ source-repository head
library
exposed-modules:
Shower
Shower.Trace
Shower.Printer
Shower.Parser
Shower.Class
Expand Down

0 comments on commit 2a61cf7

Please sign in to comment.