debug-print: A structured alternative to Show

[ debug, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Modules

  • DebugPrint
    • DebugPrint.Aeson
    • DebugPrint.Class
    • DebugPrint.Show
    • DebugPrint.Tagged
    • DebugPrint.Types

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0
Change log CHANGELOG.md
Dependencies aeson (>=2.2.3.0), base (>=4.19.2.0 && <5), containers (>=0.6.8), text (>=2.1.1), vector (>=0.13.2.0) [details]
License MIT
Author
Maintainer Freckle Education
Category Debug
Home page https://github.com/freckle/debug-print#readme
Bug tracker https://github.com/freckle/debug-print/issues
Source repo head: git clone https://github.com/freckle/debug-print
Uploaded by PatrickBrisbin at 2025-02-25T22:26:03Z
Distributions
Downloads 14 total (14 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 2025-02-26 [all 2 reports]

Readme for debug-print-0.0.0.0

[back to package description]

debug-print

Offers ToDebugPrintValue, a structured alternative to Show for printing values for testing and debugging purposes.

import DebugPrint
import DebugPrint.Aeson
import Data.Aeson qualified as Aeson
data Report = Report
  { milliseconds :: Int
  , errors :: [Text]
  }
  deriving stock Generic
  deriving anyclass (ToDebugPrintRecord, ToDebugPrintValue)

report :: Report
report = Report{ milliseconds = 5_824
               , errors = ["Warning! Problems."] }
main :: IO ()
main = hspec $ do
  it "" $ do
    Aeson.encode (debugPrintValueToAeson report) `shouldBe`
      "{\"errors\":[\"Warning! Problems.\"],\"milliseconds\":5824}"

LICENSE | CHANGELOG