[Haskell-beginners] How would you write...

Norbert Melzer timmelzer at gmail.com
Tue Apr 22 08:49:15 UTC 2014


This one doesn't work, since pappus doesn't return a list
Am 22.04.2014 10:47 schrieb "Frerich Raabe" <raabe at froglogic.com>:

> On 2014-04-22 10:00, 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.
>>
>
> [..]
>
>  (1) how can the list comprehension syntax manage it,
>>
>
> I suspect
>
>   chain1 = [ translate x y $ color red $ Circle r | i <- [1..10], (x,y,r)
> <- pappus 100 i ]
>
> would be one way to do what you want.
>
> --
> Frerich Raabe - raabe at froglogic.com
> www.froglogic.com - Multi-Platform GUI Testing
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140422/234803e1/attachment.html>


More information about the Beginners mailing list