module FileLocation
( err, undef
, debug, debugM, debugMsg, dbg, dbgMsg, trc, ltrace, ltraceM, strace
, locationToString
)
where
import FileLocation.LocationString (locationToString)
import Debug.FileLocation (debug, debugM, debugMsg, dbg, dbgMsg, trc, ltrace, ltraceM, strace)
import Debug.Trace (trace)
import Language.Haskell.TH.Syntax
err :: String -> Q Exp
err str = do
loc <- qLocation
let prefix = (locationToString loc) ++ " "
[|error (prefix ++ str)|]
undef :: Q Exp
undef = do
loc <- qLocation
let prefix = (locationToString loc) ++ " "
[|trace (prefix ++ "undefined") undefined|]