{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnishiohirokazu.hatenadiary.org%2Fentry%2F20100524%2F1274703831\" title=\"Random - \u897f\u5c3e\u6cf0\u548c\u306e\u306f\u3066\u306a\u30c0\u30a4\u30a2\u30ea\u30fc\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","blog_title":"\u897f\u5c3e\u6cf0\u548c\u306e\u306f\u3066\u306a\u30c0\u30a4\u30a2\u30ea\u30fc","author_name":"nishiohirokazu","width":"100%","published":"2010-05-24 21:23:51","version":"1.0","image_url":null,"blog_url":"https://nishiohirokazu.hatenadiary.org/","categories":["Haskell"],"url":"https://nishiohirokazu.hatenadiary.org/entry/20100524/1274703831","title":"Random","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/nishiohirokazu/","height":"190","type":"rich","description":"main\u306e\u4e2d\u3067mkStdGen\u3059\u308b\u304e\u308a\u304e\u308a\u307e\u3067IO\u30e2\u30ca\u30c9\u3067\u5305\u307e\u306a\u3044\u3001\u3063\u3066\u306e\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u305f\u3002 import Random dice :: (RandomGen g) => g -> (Int, g) dice g = randomR (1, 6) g dice_seq :: (RandomGen g) => g -> [Int] dice_seq g = let first_result = dice g in (fst first_result) : map fst (iterate (dice.snd) first_result) main = print $ take 10 $ di\u2026"}