print-debugger: Debug print formatting library.

[ debug, library, public-domain ] [ Propose Tags ]

Print debugging with stack trace for Haskell (formatted for ease of use). See screenshot: http://i.imgur.com/KCXYHNk.png


[Skip to Readme]

Modules

[Last Documentation]

  • Debug
    • Print
      • Debug.Print.StackTraceDebug

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0, 1.0.0, 1.0.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9
Dependencies base (<4.10), split [details]
License LicenseRef-PublicDomain
Author John-Michael Reed
Maintainer johnmichaelreedfas@gmail.com
Category Debug
Home page https://github.com/JohnReedLOL/HaskellPrintDebugger
Bug tracker https://github.com/JohnReedLOL/HaskellPrintDebugger/issues
Source repo head: git clone https://github.com/JohnReedLOL/HaskellPrintDebugger
Uploaded by johnreedlol at 2016-02-13T08:02:08Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 6198 total (26 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-28 [all 2 reports]

Readme for print-debugger-1.1.5

[back to package description]

HaskellPrintDebugger

Prints lines with IDE friendly stack traces in Haskell.


Example:

debugTraceIO "foobar"

foobar in thread "1" :

    at Main.call(Main.hs:41)

See screenshot: http://i.imgur.com/KCXYHNk.png


Dependencies:

  • None (except for "split" package in .cabal). Automatically imports on "cabal install print-debugger".

Instructions:

  1. Add the file "StackTraceDebug.hs" to your Haskell project.
  2. Add "import StackTraceDebug" if you want to call the function
  3. Call "debugTraceIO" with any String argument.
  4. When you are done, remove or comment out all calls to debugTraceIO.
  5. Optionally, set value "debugMode" to "False" in "StackTraceDebug.hs" to mute all calls to "debugTraceIO".

Benefits:

  • Does not require to be compiled with "-prof"
  • Easier to locate your print statements
  • Location of print statement can be highlighted in an IDE
  • Easy to turn print statemments on/off without having to manually uncomment each one.
  • Public Domain

Requirements:

  • GHC 7.10.1 (or greater)
  • "-XImplicitParams" compiler option
  • "split" package or addition of ", split" to "build-depends" line in ".cabal" file

Configuration:

Sample ".cabal" file:

name: HaskellProject1

version: 1.0

Build-Type: Simple

cabal-version: >= 1.2

executable HaskellProject1

main-is: Main.hs

hs-source-dirs: src

build-depends: base, split

Sample compilation:

    $> ghc StackTraceDebug.hs -Wall -Werror -XImplicitParams


Know bugs:

http://stackoverflow.com/questions/35354153/haskell-cannot-import-ghc-srcloc

^ Doesn't build correctly on Caball Ubuntu 14.04 with old (ubuntu LTS repo) version of GHC.

(but compiles fine on Windows with "ghc StackTraceDebug.hs -Wall -Werror -XImplicitParams")

To report or pinpoint bugs, email johnmichaelreedfas@gmail.com