{"description":"sequence\u3092\u4f7f\u3048\u3070\u3001\u8907\u6570\u500b\u3042\u308b\u30e2\u30ca\u30c9\u5024\u30921\u3064\u306e\u30e2\u30ca\u30c9\u5024\u306b\u96c6\u3081\u3089\u308c\u308b\u3002 xs :: (Functor m, Monad m) => m [()] xs = sequence [return x' | x' <- [(),()..]] xs\u306f\u30e2\u30ca\u30c9\u306b\u5305\u307e\u3063\u305f\u30ea\u30b9\u30c8\u306a\u306e\u3067\u3001fmap\u3092\u4f7f\u3063\u3066head\u3092\u6301\u3061\u4e0a\u3052\u308c\u3070\u5148\u982d\u8981\u7d20\u304c\u3068\u308c\u308b\u3002 x :: (Functor m, Monad m) => m () x = fmap head xs \u3053\u308c\u3092Identity\u30e2\u30ca\u30c9\u3068\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u308b\u3002 > runIdentity x ()\u3088\u3057\uff01 Writer\u30e2\u30ca\u30c9\u3068\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u308b\u3002 > runWriter (x :\u2026","blog_title":"Pixel Pedals of Tomakomai","author_name":"hiratara","categories":["\u6280\u8853"],"type":"rich","url":"https://hiratara.hatenadiary.jp/entry/20130518/1368862138","title":"fmap head VS sequence","version":"1.0","blog_url":"https://hiratara.hatenadiary.jp/","published":"2013-05-18 16:28:58","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","image_url":null,"width":"100%","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhiratara.hatenadiary.jp%2Fentry%2F20130518%2F1368862138\" title=\"fmap head VS sequence - Pixel Pedals of Tomakomai\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/hiratara/"}