{"id":11284,"date":"2015-05-21T10:00:14","date_gmt":"2015-05-21T14:00:14","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=11284"},"modified":"2015-05-21T10:00:14","modified_gmt":"2015-05-21T14:00:14","slug":"first-class-statements","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/05\/21\/first-class-statements\/","title":{"rendered":"First-Class &ldquo;Statements&rdquo;"},"content":{"rendered":"<p><a href=\"http:\/\/blog.jle.im\/entry\/first-class-statements\">Justin Le<\/a> (via <a href=\"https:\/\/twitter.com\/andy_matuschak\/status\/599967708935946240\">Andy Matuschak<\/a>):<\/p>\n<blockquote cite=\"http:\/\/blog.jle.im\/entry\/first-class-statements\"><p>One thing I&rsquo;ve really always appreciated about Haskell is that all &ldquo;statements&rdquo; in Haskell (or at least, what would be statements in other languages) are first-class members of the language. That is, (imperative) statements are literally just normal objects (no different from numbers, or lists, or booleans) &mdash; they can be saved to variables, passed to functions, transformed using normal functions, copied, etc. Haskell doesn&rsquo;t have statements &mdash; everything is an expression, representing normal data! This really opens up a whole world of possibilities for not only reasoning about your code, but also for new ways to frame ideas in contexts of parallelism, concurrency, exceptions, DSLs, and more.<\/p>\n<p>[&#8230;]<\/p>\n<p>In many other languages, sequencing actions is a special part of the syntax &mdash; a semicolon, usually. In Haskell, sequencing is not special &mdash; it&rsquo;s just a normal function on normal data structures.<\/p>\n<p>You can even make your own &ldquo;first class&rdquo; control flow!<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Justin Le (via Andy Matuschak): One thing I&rsquo;ve really always appreciated about Haskell is that all &ldquo;statements&rdquo; in Haskell (or at least, what would be statements in other languages) are first-class members of the language. That is, (imperative) statements are literally just normal objects (no different from numbers, or lists, or booleans) &mdash; they can [&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":[361,46,71],"class_list":["post-11284","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-haskell","tag-languagedesign","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11284","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=11284"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11284\/revisions"}],"predecessor-version":[{"id":11285,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11284\/revisions\/11285"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=11284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=11284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=11284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}