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

Haskell help

Name: Anonymous 2010-03-28 10:15

Show how the single comprehension [(x , y) | x ← [1, 2, 3], y ←
[4, 5, 6]] with two generators can be re-expressed using two comprehensions
with single generators. Hint: make use of the library function concat
and nest one comprehension within the other.

It's been easy up until now, but I can't figure out how to nest one comprehension within the other. Any ideas besides reading SICP?

Name: Anonymous 2010-03-28 10:29

Is there anything wrong with [(x,x+3)|x<-[1,2,3]]? Is it too obvious?

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