
22 Apr
2014
22 Apr
'14
4:39 a.m.
On Tuesday 22 April 2014, 03:00:20, John M. Dlugosz wrote:
chain1 = [ translate x y $ color red $ Circle r | (x,y,r) <- pappus 100 [1..10] ]
The above is not right, as the comprehension syntax doesn't see the input range buried in an argument.
What's the right way to express
pap1 = translate x y $ color red $ Circle r where (x,y,r) = pappus 100 1
where 1 is [1..10] and I get a list of results? (pap1 does work as expected)
(1) how can the list comprehension syntax manage it,
If I guess your intentions right: chain1 = [ translate x y $ color red $ Circle r | (x,y,z) <- map (pappus 100) [1 .. 10]]