{"id":40,"date":"2007-08-03T22:37:20","date_gmt":"2007-08-04T05:37:20","guid":{"rendered":"http:\/\/www.elbeno.com\/haskell_soe_blog\/?p=40"},"modified":"2008-01-08T07:12:39","modified_gmt":"2008-01-08T15:12:39","slug":"exercise-811","status":"publish","type":"post","link":"https:\/\/www.elbeno.com\/haskell_soe_blog\/?p=40","title":{"rendered":"Exercise 8.11"},"content":{"rendered":"<p>See Exercises <a href=\"http:\/\/www.elbeno.com\/haskell_soe_blog\/?p=9\">2.4<\/a> and <a href=\"http:\/\/www.elbeno.com\/haskell_soe_blog\/?p=15\">5.1<\/a>. Then:<\/p>\n<pre lang=\"haskell\">area'' :: Shape -> Float\r\narea'' (Polygon (v1:vs)) = if convex (Polygon (v1:vs))\r\n                           then let areas = map ((v2, v3) -> triArea v1 v2 v3)\r\n                                               (zip vs (tail vs))\r\n                                in foldl (+) 0 areas\r\n                           else error \"Non-convex polygon\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>See Exercises 2.4 and 5.1. Then: area&#8221; :: Shape -> Float area&#8221; (Polygon (v1:vs)) = if convex (Polygon (v1:vs)) then let areas = map ((v2, v3) -> triArea v1 v2 v3) (zip vs (tail vs)) in foldl (+) 0 areas else error &#8220;Non-convex polygon&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/posts\/40"}],"collection":[{"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":0,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}