haskell-debugginglisted
Install: claude install-skill ivelten/claude-haskell-skills
# Haskell Debugging
Two complementary approaches: the **GHCi built-in debugger** (fast, terminal-based, no setup beyond GHCi) and **DAP adapters** (integrated into VS Code and other editors with a GUI).
## GHCi debugger
The GHCi debugger is always available — no extra packages. Load your module with `cabal repl` or `ghci`, then use these commands:
### Setting breakpoints
```
-- By function name
:break MyModule.myFunction
-- By module and line number
:break MyModule 42
-- List active breakpoints
:show breaks
-- Delete a breakpoint by index (from :show breaks output)
:delete 0
```
### Stepping through execution
```
-- Run until next breakpoint; starts evaluation
:continue
-- Step into the next redex (one reduction)
:step
-- Step over (run to next line without entering calls)
:steplocal
-- Step to next breakpoint in a specific module
:stepmodule MyModule
```
### Inspecting state at a breakpoint
```
-- Print a variable (forces evaluation)
:print x
-- Force a thunk and print (like :print but evaluates completely)
:force x
-- Show current locals in scope
:show bindings
-- Evaluate an expression in the current context
x + 1
```
### Tracing (non-interactive)
When you don't want to step but want a call history:
```
-- Run with tracing enabled; builds a call history
:trace myFunction arg1
-- Show the call history after a breakpoint or exception
:history
-- Show the back trace
:back
```
### Catching exceptions
```
-- Break on any exception
:set -fbreak-on-except