Personal tools

Talk:GHC/GHCi debugger

From HaskellWiki

Revision as of 14:46, 20 July 2006 by ThiagoArrais (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How do I use the debugger on implicitly typed and/or class typed functions? Here is what I am trying:

qsort [] = [] qsort (a:as) = breakpoint $ (qsort left) ++ [a] ++ (qsort right)

 where left = filter (<=a) as
       right = filter (>a) as

when I execute this into the patched ghci, here is what I get:

*Main> qsort [8, 4, 0, 3, 1, 23, 11, 18]
Local bindings in scope:
src/Main.hs:7> left

<interactive>:1:0: Not in scope: `left'
src/Main.hs:7> right

<interactive>:1:0: Not in scope: `right'
src/Main.hs:7> a

<interactive>:1:0: Not in scope: `a'

If I try specifying the inferred type (qsort :: Ord a => [a] -> [a]), I still get the same result. But if I specify a concrete type for the qsort function (qsort :: [Int] -> [Int]), the bindings in scope are shown and I can inspect the values.

ThiagoArrais 14:46, 20 July 2006 (UTC)

Is there a mailing list or any kind of user group for this?

ThiagoArrais 14:46, 20 July 2006 (UTC)