
How big are those lists? GHC will not be able to work out x+y+z < 50 will
never be true again, it will have to exhaustively consider *every*
combination.
On Sat, 23 Nov 2019, 6:38 pm Alexander Chen,
Hi,
I am doing some further learning with euler now in Haskell instead of Julia. But I am getting something strange.
[x+y+z | x <- a2, y <- b3, z <- c4, (x+y+z) < 50]
a2, b3, c4 are all finite lists derived from the lazy list of the primes package. the output is:
[28,47,33,49
this is not a typo it is still calculating hence the missing bracket (for the last couple of hours, when to a christmas fair in between). The only thing is that, this should be the answer:
[28,47,33,49]
so it should be done but its not. what am I doing wrong?
best,
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners