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
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Hi all,
How do I write a statement that spans multiple lines?
I have this function:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
This should all be in one line. I know some ways to make the
J. Garrett Morris wrote:
Indent the second line:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
Thanks!
Daniel.
--
/\/`) http://oooauthors.org
/\/_/ http://opendocumentfellowship.org
/\/_/
\/_/I am
Daniel Carrera wrote:
Hi all,
How do I write a statement that spans multiple lines?
I have this function:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
This should all be in one line. I know some ways to make the line
shorter, like
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 ]
Greg Buchholz
___
Haskell-Cafe
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