{"url":"https://fumieval.hatenablog.com/entry/2014/02/11/205916","author_url":"https://blog.hatena.ne.jp/fumiexcel/","title":"\u7d99\u7d9a\u6e21\u3057\u306aHaskell\u30e9\u30a4\u30d5","provider_url":"https://hatena.blog","width":"100%","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffumieval.hatenablog.com%2Fentry%2F2014%2F02%2F11%2F205916\" title=\"\u7d99\u7d9a\u6e21\u3057\u306aHaskell\u30e9\u30a4\u30d5 - \u30e2\u30ca\u30c9\u3068\u308f\u305f\u3057\u3068\u30b3\u30e2\u30ca\u30c9\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2014-02-11 20:59:16","type":"rich","height":"190","version":"1.0","author_name":"fumiexcel","categories":[],"provider_name":"Hatena Blog","blog_title":"\u30e2\u30ca\u30c9\u3068\u308f\u305f\u3057\u3068\u30b3\u30e2\u30ca\u30c9","blog_url":"https://fumieval.hatenablog.com/","description":"CPS(Continuation passing style, \u7d99\u7d9a\u6e21\u3057\u30b9\u30bf\u30a4\u30eb)\u306f\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u66f8\u304d\u65b9\u306e\u4e00\u3064\u3067\u3042\u308b\u3002CPS\u3092\u5c0e\u5165\u3059\u308b\u7c21\u5358\u306a\u4f8b\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u3088\u3046\u3002 \u307e\u305a\u3001\u5165\u529b\u3055\u308c\u305f\u6570\u5024\u304c3\u306e\u500d\u6570\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3002 foo :: IO Bool foo = do n <- readLn :: IO Int return (n `mod` 3 == 0) \u3053\u3053\u3067\u300cCPS\u5909\u63db\u300d\u306a\u308b\u5100\u5f0f\u3092\u884c\u3046\u3068\u2026\u3053\u3046\u306a\u308b\uff01 foo' :: (Bool -> IO r) -> IO r foo' cont = do n <- readLn :: IO Int co\u2026"}