{"id":1028,"date":"2016-10-23T22:34:25","date_gmt":"2016-10-23T13:34:25","guid":{"rendered":"http:\/\/randt.jp\/?p=1028"},"modified":"2016-10-23T22:39:08","modified_gmt":"2016-10-23T13:39:08","slug":"haskell%e4%ba%8b%e5%a7%8b%e3%82%81","status":"publish","type":"post","link":"https:\/\/randt.jp\/?p=1028","title":{"rendered":"haskell\u4e8b\u59cb\u3081"},"content":{"rendered":"<p>haskell\u3092\u306f\u3058\u3066\u307f\u308b\u3002\u307e\u305a\u306f\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u304b\u3089\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre>\r\nimport System.Environment\r\nimport System.IO\r\n\r\nmain::IO()\r\nmain = do\r\n    args < - getArgs\r\n    case args of\r\n        args -> getContents >>= putStr\r\n        _ -> mapM_(\\x -> readFile x >>= putStr) args\r\n<\/pre>\n<ul>\n<li>getArgs\u306f\u5f15\u6570\u3092[String]\u3067\u8fd4\u3057\u3066\u304f\u308c\u308b\u3002'&lt;-&#8216;\u306f\u7d50\u679c\u3092args\u306b\u675f\u7e1b\u3059\u308b\u3002<\/li>\n<li>case args of \u306f\u6761\u4ef6\u5206\u5c90<\/li>\n<li>args\u304c'[]&#8217;\u7a7a\u30ea\u30b9\u30c8\u306a\u3089 getContents\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u7d50\u679c\u3092pu\uff54St\uff52\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u6e21\u3059\u3002<\/li>\n<li>\u305d\u308c\u4ee5\u5916\u306a\u3089\u3001args\u306e\u5404\u8981\u7d20\u306b\u7121\u540d\u95a2\u6570(\\x -&gt; readFile x &gt;&gt;= putStr)\u3092\u30de\u30c3\u30d7<\/li>\n<\/ul>\n<p>\u53c2\u7167\u30b5\u30a4\u30c8<\/p>\n<ul>\n<li><a href=\"http:\/\/walk.wgag.net\/haskell\/io.html\" target=\"_blank\">\u30a6\u30a9\u30fc\u30af\u30b9\u30eb\u30fc Haskell &gt; \u5165\u51fa\u529b<\/a><\/li>\n<li><a href=\"http:\/\/capm-network.com\/?tag=Haskell-%E7%84%A1%E5%90%8D%E9%96%A2%E6%95%B0\" target=\"_blank\">Haskell-\u7121\u540d\u95a2\u6570<\/a><\/li>\n<li><a href=\"https:\/\/randt.jp\/?p=1024\" target=\"_blank\">\u304a\u6c17\u697d Haskell \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>haskell\u3092\u306f\u3058\u3066\u307f\u308b\u3002\u307e\u305a\u306f\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u304b\u3089\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3067\u304d\u308b\u3002 import System.Environment import System.IO ma &#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/randt.jp\/?p=1028\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137,19],"tags":[],"class_list":["post-1028","post","type-post","status-publish","format-standard","hentry","category-haskell","category-19"],"_links":{"self":[{"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/posts\/1028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/randt.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1028"}],"version-history":[{"count":4,"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/posts\/1028\/revisions"}],"predecessor-version":[{"id":1034,"href":"https:\/\/randt.jp\/index.php?rest_route=\/wp\/v2\/posts\/1028\/revisions\/1034"}],"wp:attachment":[{"href":"https:\/\/randt.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randt.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randt.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}