{"id":289,"date":"2003-03-12T20:59:04","date_gmt":"2003-03-13T01:59:04","guid":{"rendered":"\/?p=289"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"type_checking_that_doesnt","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2003\/03\/12\/type_checking_that_doesnt\/","title":{"rendered":"Type Checking That Doesn&rsquo;t Suck"},"content":{"rendered":"<p>\n\nThese <a href=\"http:\/\/perl.plover.com\/yak\/typing\/notes.html\">slides<\/a> from a Perl talk include a good little introduction to ML- and Haskell-style type checking:\n\n<\/p>\n\n\n\n<blockquote cite=\"http:\/\/perl.plover.com\/yak\/typing\/notes.html\">\n\nIf we put a list of strings into our <tt>sort<\/tt> function, the\n\ncompiler says that when it returns, it will have turned it into a list\n\nof <tt>int<\/tt>s.  This is impossible.  One possible explanation is\n\nthat the <tt>sort<\/tt> function never returns.  And in fact this is\n\nthe case.  The <tt>sort<\/tt> function, as we wrote it, goes into an\n\ninfinite loop on any input except the empty list. This means that the type checker has found an infinite loop bug in our program. Ponder that for a minute. \n\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>These slides from a Perl talk include a good little introduction to ML- and Haskell-style type checking: If we put a list of strings into our sort function, the compiler says that when it returns, it will have turned it into a list of ints. This is impossible. One possible explanation is that the sort [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}