{"published":"2019-05-23 13:44:48","categories":["\u6570\u5b66","Ruby"],"author_name":"obelisk2","blog_title":"Camera Obscura","image_url":"https://images-fe.ssl-images-amazon.com/images/I/51kSuWt53uL._SL160_.jpg","title":"\u30c1\u30e3\u30fc\u30c1\u6570\u306e\u7c21\u5358\u306a\u8a08\u7b97\uff08Ruby\uff09","provider_name":"Hatena Blog","blog_url":"https://obelisk.hatenablog.com/","version":"1.0","type":"rich","author_url":"https://blog.hatena.ne.jp/obelisk2/","provider_url":"https://hatena.blog","description":"Wikipedia \u306e OCaml \u306e\u9805\u76ee\u3092\u8aad\u3093\u3067\u3044\u305f\u3089\u3001OCaml \u3067\u306f\u30c1\u30e3\u30fc\u30c1\u6570\u306e\u8a08\u7b97\u304c\u304d\u308c\u3044\u306b\u66f8\u3051\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u3002 let zero f x = x let succ n f x = f (n f x) let one = succ zero let two = succ (succ zero) let add n1 n2 f x = n1 f (n2 f x) let to_int n = n (fun k -> k+1) 0 let _ = print (add (succ two) two) \u307b\u3046\u3001\u3055\u3059\u304c\u3067\u3042\u308b\u3002\u3067\u306f\u6211\u304c Ruby \u3067\u306f\u4f3c\u305f\u3088\u3046\u306a\u3053\u3068\u306f\u53ef\u80fd\u3067\u3042\u308b\u306e\u304b\u3002OCaml \u307b\u2026","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2019%2F05%2F23%2F134448\" title=\"\u30c1\u30e3\u30fc\u30c1\u6570\u306e\u7c21\u5358\u306a\u8a08\u7b97\uff08Ruby\uff09 - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","url":"https://obelisk.hatenablog.com/entry/2019/05/23/134448"}