[Haskell-cafe] Statements spanning multiple lines?

Bulat Ziganshin bulatz at HotPOP.com
Thu Dec 22 18:07:03 EST 2005


Hello Greg,

Thursday, December 22, 2005, 8:15:08 PM, you wrote:

GB>     You might also like to try the slightly more efficient...

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

"c <- [b+1..n]" is even better :)

GB>                     a*a + b*b == c*c ]



-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Haskell-Cafe mailing list