Compiler problem or dumb mistake?
Here's the problematic snippet, using GHC 5.00.2: mapWidList :: [(Int,Int,Bool)] -> [WidNode] -> Int-> [WidNode] mapWidList showList widNodes seq --map (\x -> (checkWid showList x (widNodes!!x))) -- [0 .. ((length widNodes) -1)] | (length widNodes ) < seq + 1 = [] | otherwise = (checkWid showList seq (widNodes!!seq) ): (mapWidList showList widNodes (seq+1)) The commented lines are what I would really like, but trace indicated that the anonymous function is never invoked, so I wrote out explictly recursive code. However, while trace indicates that the both alternatives are appropriately repeatedly tested, checkWid is never invoked. I have modified checkWid to assure that laziness is not the problem (I suffed in code that prevents prediction of the result returned by checkWid), so something else is going on here. Anyone care to take a shot at this one? Thanks in advance. Murray Gross mgross@dorsai.org
Further to my earlier post on the same subject: The problem seems to be not in my code, but in some sort of nasty interaction between thread dispatching, the trace function, and possibly, Gtk: It appears that trace dumps what is expected (indicating execution of functions that I thought weren't being executed) when I click on windows displayed by GTK+hs in another thread (many thanks to Manuel Chakravarty for solving a nasty problem there). Please note that the thread containing the code in which trace seems to be failing does in fact appear to be executing to completion, although I am not yet able to determine whether execution is correct (the code is only partially complete). Anyone want to stick their fingers into this one? (I have lots of burn ointment if you're afraid of the heat :) ). Murray Gross mgross@dorsai.org
participants (1)
-
mgross@dorsai.org