file-location 0.4.1 → 0.4.2
raw patch · 4 files changed
+9/−7 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Debug.Util: debugMsgIf :: Show a => String -> (a -> Bool) -> a -> a
+ FileLocation: debugMsgIf :: Show a => String -> (a -> Bool) -> a -> a
Files
- Debug/FileLocation.hs +1/−1
- Debug/Util.hs +5/−1
- FileLocation.hs +2/−4
- file-location.cabal +1/−1
Debug/FileLocation.hs view
@@ -19,7 +19,7 @@ [|(\x -> ltrace pre x)|] -- | TH version of Debug.Trace.trace that prints a value and a message--- prefix).+-- prefix. dbgMsg :: String -> Q Exp dbgMsg msg = do loc <- qLocation
Debug/Util.hs view
@@ -1,7 +1,7 @@ -- | functions that help you with debugging. -- Most would make sense in the Debug.Trace module module Debug.Util - (debug, debugM, debugMsg, ltrace, ltraceM, strace, traceId)+ (debug, debugM, debugMsg, debugMsgIf, ltrace, ltraceM, strace, traceId) where import Debug.Trace (trace)@@ -16,6 +16,10 @@ debugMsg :: Show a => String -> a -> a debugMsg msg = ltrace ("DEBUG: " ++ msg) +-- | A version of Debug.Trace.trace that just prints a value and a message.+-- This should be included in Debug.Trace+debugMsgIf :: Show a => String -> (a -> Bool) -> a -> a+debugMsgIf msg cond x = if cond x then ltrace ("DEBUG: " ++ msg) x else x -- | monadic debug - like debug, but works as a standalone line in a monad -- TODO: TH version with error loaction info
FileLocation.hs view
@@ -2,7 +2,7 @@ -- | see Debug.FileLocation module for more definitions module FileLocation ( err, undef, fromJst, fromRht- , debug, debugM, debugMsg, dbg, dbgMsg, trc, ltrace, ltraceM, strace+ , debug, debugM, debugMsg, debugMsgIf, dbg, dbgMsg, trc, ltrace, ltraceM, strace , locationToString , thrwIO, thrwsIO )@@ -10,11 +10,9 @@ import FileLocation.LocationString (locationToString) import Debug.FileLocation (debug, debugM, debugMsg, dbg, dbgMsg, trc, ltrace, ltraceM, strace)+import Debug.Util (debugMsgIf) import Control.Exception.FileLocation (thrwIO, thrwsIO) import Debug.Trace (trace)--- future plans--- import Control.Exception.FileLocation (thrw, thrwIO)- import Language.Haskell.TH.Syntax -- | like Prelude.error, but gives the file location
file-location.cabal view
@@ -1,5 +1,5 @@ Name: file-location-Version: 0.4.1+Version: 0.4.2 Synopsis: common functions that show file location information Homepage: https://github.com/gregwebs/FileLocation.hs License: BSD3