no breakpoint location for list construction?
Peter Hercek
phercek at gmail.com
Wed Jan 21 15:08:25 EST 2009
Hi,
Is it correct that there is no breakpoint location at list construction
place: line "5 then [x]" ?
Notice that :steplocal does not stop there before "[1]" is printed when
debugging expression "test 1".
Thanks,
Peter.
status:0 peter at metod [721] ~/tmp
% cat b.hs
hlp x = [-x]
test x =
if x >= 0
then [x]
else hlp x
status:0 peter at metod [722] ~/tmp
% ghci b.hs
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Loading package old-locale-1.0.0.0 ... linking ... done.
Loading package old-time-1.0.0.0 ... linking ... done.
Loading package filepath-1.1.0.0 ... linking ... done.
Loading package directory-1.0.0.0 ... linking ... done.
Loading package ghciext-0.1 ... linking ... done.
[1 of 1] Compiling Main ( b.hs, interpreted )
Ok, modules loaded: Main.
*Main> :break 4
Breakpoint 0 activated at b.hs:4:5-10
*Main> test 1
Stopped at b.hs:4:5-10
_result :: [a] = _
3 test x =
4 if x >= 0
5 then [x]
[b.hs:4:5-10] *Main> :steplocal
[1]
*Main> test (-1)
Stopped at b.hs:4:5-10
_result :: [a] = _
3 test x =
4 if x >= 0
5 then [x]
[b.hs:4:5-10] *Main> :steplocal
Stopped at b.hs:6:9-13
_result :: [Integer] = _
x :: Integer = -1
5 then [x]
6 else hlp x
7
[b.hs:6:9-13] *Main> :steplocal
[1]
*Main> :quit
Leaving GHCi.
status:0 peter at metod [723] ~/tmp
%
More information about the Glasgow-haskell-users
mailing list