
On Thu, Mar 3, 2011 at 5:13 PM, Daniel Fischer
On Thursday 03 March 2011 17:40:52, Britt Anderson wrote:
This does fix the problem. Thank you. But raises a new question. Since that list was being constructed like this
where trialList oldps = [[(h' i) , (p' i)] | i <- [1 ..], i < tn]
where trialList oldps = [[h' i, p' i] | i <- takeWhile (< tn) [1 .. ]]
The probem is that the compiler can't know that i never gets smaller than tn again once the first i >= tn is reached¹, so it is busy generating ever larger integers and testing them against tn, never finishing (well, it will finish when i is large enough to blow your memory, perhaps when i >= 2^(2^31) on a 32-bit system, I don't know how overflow of Integer is handled)
And the fix would be to code as where trialList oldps = [[h' i, p' i] | i <- [1..tn]] PS: Why aren't you using a tuple? =) -- Felipe.