Ronny Wichers Schreur <[EMAIL PROTECTED]> writes:
> area :: Shape -> Float
> area (Polygon vertices)
> = 0.5 * sum [(x1-x2)*(y1+y2)
> | (Vertex x1 y1, Vertex x2 y2)
> <- zip vertices (tail vertices ++ [head vertices])]
thanks, John Huges pointed me to a simular solution, JFYI list
comprehension is not covered in that chapter nor are anonymous
functions. I found that list comprehension is syntactic sugar for a
map, just by sheeting (to page 90 in SOE). But I do not understand how
to replace one by the other here. I'll have to wait and try till I
found what list comprehansion stands for.
Thanks anyway
Friedrich
--
for e-mail reply remove all after .com