
18 Jan
2007
18 Jan
'07
5 p.m.
Hello, is there a way to trace a list comprehension such as concat1 :: [[a]] -> [a] concat1 xss = [ x | xs <- xss, x <- xs ] I would like to see what gets stored in xs. Cheers, phiroc

18 Jan
18 Jan
5:04 p.m.
On Jan 18, 2007, at 17:00 , Philippe de Rochambeau wrote:
concat1 :: [[a]] -> [a] concat1 xss = [ x | xs <- xss, x <- xs ]
I would like to see what gets stored in xs.
Offhand:
import Debug.Trace
concat1 :: Show a => [[a]] -> [a] concat1 xss = [ x | xs <- xss, x <- trace (show xs) xs ]
(The Show qualification is kinda unfortunate.) -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
6700
Age (days ago)
6700
Last active (days ago)
1 comments
2 participants
participants (2)
-
Brandon S. Allbery KF8NH
-
Philippe de Rochambeau