Greg Buchholz wrote:
    You might also like to try the slightly more efficient...

pyth n = [(a,b,c) | a <- [1..n], b <- [a..n], c <- [a+1..n], a*a + b*b == c*c ]

Cool. I'm amazed that actually works. I've been writing filters upon filters in all my functions because I didn't realize you could write things like that.

Cheers,
Daniel.
--
     /\/`) http://oooauthors.org
    /\/_/  http://opendocumentfellowship.org
   /\/_/
   \/_/    I am not over-weight, I am under-tall.
   /
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to