Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Learning Haskell

Name: Anonymous 2011-08-21 20:24

In this list comprehension:


let rightTriangles = [ (a,b,c) | c <- [1..10], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2]


what is the behavior of "1..c" and "1..b"?

Name: Anonymous 2011-08-21 20:31

Haskell on Homosexuals

Name: Anonymous 2011-08-21 21:08

>>1
They are the lists [1, 2, 3, ..., c] and [1, 2, 3, ..., b], respectively.

Name: Anonymous 2011-08-21 23:17

>>1
You know haskell has REPL for a reason.

Don't change these.
Name: Email:
Entire Thread Thread List