{"id":50,"date":"2007-08-08T23:18:10","date_gmt":"2007-08-09T06:18:10","guid":{"rendered":"http:\/\/www.elbeno.com\/haskell_soe_blog\/?p=50"},"modified":"2008-01-08T09:59:17","modified_gmt":"2008-01-08T17:59:17","slug":"exercise-98","status":"publish","type":"post","link":"https:\/\/www.elbeno.com\/haskell_soe_blog\/?p=50","title":{"rendered":"Exercise 9.8"},"content":{"rendered":"<pre lang=\"haskell\">power :: (a -> a) -> Int -> a -> a\r\npower f 0 = (\\x -> x)\r\npower f n = (\\x -> f (power f (n-1) x))<\/pre>\n<p>Since the function is called <tt>power<\/tt>, there is one obvious application that springs to mind, i.e. raising to a power:<\/p>\n<pre lang=\"haskell\">raise :: Int -> Int -> Int\r\nraise x y = power (*x) y 1<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>power :: (a -> a) -> Int -> a -> a power f 0 = (\\x -> x) power f n = (\\x -> f (power f (n-1) x)) Since the function is called power, there is one obvious application that springs to mind, i.e. raising to a power: raise :: Int -> Int -> [&hellip;]<\/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\/50"}],"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=50"}],"version-history":[{"count":0,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elbeno.com\/haskell_soe_blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}