{"id":1002051,"date":"2009-01-23T00:48:02","date_gmt":"2009-01-23T05:48:02","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/?p=1002051"},"modified":"2009-01-23T00:48:02","modified_gmt":"2009-01-23T05:48:02","slug":"any-with-foldr","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/haskell\/2009\/01\/23\/any-with-foldr\/","title":{"rendered":"any with foldr"},"content":{"rendered":"<pre>myAny :: (a -> Bool) -> [a] -> Bool\r\nmyAny f [] = False\r\nmyAny f (x:xs) = foldr step False xs\r\n     where step x acc = acc || f x \r\n<\/pre>\n<p>I&#8217;m beginning to hate type inference. Yes the compiler can figure out the types, but the human (i.e. me) often can&#8217;t without running the compiler. Redundancy and verbosity are not bugs. They are features. Human language (e.g. English) is verbose and redundant for good reason. Redundancy helps humans understand. <\/p>\n<p>The source code is not just for the compiler. Otherwise we&#8217;d write in machine language. User interface factors need to be considered in the design of programming languages. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>myAny :: (a -> Bool) -> [a] -> Bool myAny f [] = False myAny f (x:xs) = foldr step False xs where step x acc = acc || f x I&#8217;m beginning to hate type inference. Yes the compiler can figure out the types, but the human (i.e. me) often can&#8217;t without running the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-1002051","post","type-post","status-publish","format-standard","hentry","category-haskell"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1002051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1002051"}],"version-history":[{"count":3,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1002051\/revisions"}],"predecessor-version":[{"id":1002059,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1002051\/revisions\/1002059"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1002051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1002051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1002051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}