packages feed

haskell-debugger-view 0.2.0.0 → 0.2.1.0

raw patch · 3 files changed

+22/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ GHC.Debugger.View.Class: instance GHC.Debugger.View.Class.DebugView GHC.Internal.Exception.Type.SomeException

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for haskell-debugger-view +## 0.2.1.0 -- 2026-02-24++* Add `DebugView` instance for `SomeException`+* Documentation fixes+ ## 0.2.0.0 -- 2026-01-05  * Add support for more complex debug visualizations using the Program abstraction
haskell-debugger-view.cabal view
@@ -1,6 +1,6 @@ cabal-version:   3.12 name:            haskell-debugger-view-version:         0.2.0.0+version:         0.2.1.0 license:         BSD-3-Clause author:          Matthew Pickering, Rodrigo Mesquita maintainer:      matthewtpickering@gmail.com, rodrigo@well-typed.com@@ -22,6 +22,11 @@  common warnings     ghc-options: -Wall++source-repository head+    type: git+    location: https://github.com/well-typed/haskell-debugger+    subdir: haskell-debugger-view  library     import:           warnings
src/GHC/Debugger/View/Class.hs view
@@ -51,6 +51,7 @@  import Data.Int import Data.Word+import Control.Exception  -- | Custom handling of debug terms (e.g. in the variables pane, or when -- inspecting a lazy variable)@@ -75,7 +76,7 @@   debugFields :: a -> Program VarFields  -- | The 'Program' abstraction allows more complicated 'DebugView' instances--- to be constructed. The debugger will interpreter a 'Program' lazily when+-- to be constructed. The debugger will interpret a 'Program' lazily when -- determining how to display a variable. -- -- At the moment the only interesting query when constructing a program is determining@@ -180,6 +181,15 @@     [ ("fst", VarFieldValue x)     , ("snd", VarFieldValue y) ] +instance DebugView SomeException where+  debugValue e = simpleValue (displayException e) True+  debugFields e@(SomeException exc) =+    let !ctx = someExceptionContext e+    in pure $ VarFields+    [ ("exception", VarFieldValue exc)+    , ("context", VarFieldValue ctx)+    ]+ -- | This instance will display up to the first 50 forced elements of a list. instance {-# OVERLAPPABLE #-} DebugView [a] where   debugValue [] = simpleValue "[]" False@@ -219,4 +229,3 @@ toVarFieldsIO x =   case x of     VarFields fls -> [ (pure fl_s, b) | (fl_s, b) <- fls]-