
On 2014-08-18 20:22, Curt McDowell wrote:
Funny, I was trying the same Homework, implemented interleaveStreams using the same algorithm you did (taking one item from each stream per recursive call), and got the same result with the ruler function hanging. It was also fixed by changing interleaveStreams to take from just one stream per call and switch back and forth between streams.
I hit the same problem when I did the exercise. In fact, it made me post this question on StackOverflow, asking about how pattern matching might cause the function to work differently: http://stackoverflow.com/questions/25078598/why-would-using-head-tail-instea... I thought the answers were quite enlightening, if only to emphasize that debugging this kind of problem is really difficult (to me). I only noticed that not using pattern matching for the second argument of 'interleave' helps by accident... -- Frerich Raabe - raabe@froglogic.com www.froglogic.com - Multi-Platform GUI Testing