{"id":8202,"date":"2013-11-08T13:30:52","date_gmt":"2013-11-08T18:30:52","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8202"},"modified":"2013-11-08T13:30:52","modified_gmt":"2013-11-08T18:30:52","slug":"why-maybe-is-better-than-null","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/11\/08\/why-maybe-is-better-than-null\/","title":{"rendered":"Why Maybe Is Better Than Null"},"content":{"rendered":"<p><a href=\"http:\/\/nickknowlson.com\/blog\/2013\/04\/16\/why-maybe-is-better-than-null\/\">Nick Knowlson<\/a> (via <a href=\"https:\/\/twitter.com\/tjw\/status\/398675554452242432\">Tim Wood<\/a>):<\/p>\n<blockquote cite=\"http:\/\/nickknowlson.com\/blog\/2013\/04\/16\/why-maybe-is-better-than-null\/\"><p>Maybe, at its core, is a construct that allows programmers to <strong>move null checks into the type system<\/strong>, so they can be enforced at <em>compile-time<\/em>. Instead of forgetting to deal with a null check and finding out with an exception at run-time, you forget to deal with a null check and <em>find out with an error at compile-time,<\/em> before anyone else even sees it! And that&rsquo;s <strong>not just some<\/strong> null checks, that&rsquo;s <strong>all of them!<\/strong><\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Nick Knowlson (via Tim Wood): Maybe, at its core, is a construct that allows programmers to move null checks into the type system, so they can be enforced at compile-time. Instead of forgetting to deal with a null check and finding out with an exception at run-time, you forget to deal with a null check [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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":[45,361,84,46,71],"class_list":["post-8202","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-haskell","tag-java","tag-languagedesign","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8202","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=8202"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8202\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}