<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hiratara</author_name>
  <author_url>https://blog.hatena.ne.jp/hiratara/</author_url>
  <blog_title>Pixel Pedals of Tomakomai</blog_title>
  <blog_url>https://hiratara.hatenadiary.jp/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>sequenceを使えば、複数個あるモナド値を1つのモナド値に集められる。 xs :: (Functor m, Monad m) =&gt; m [()] xs = sequence [return x' | x' &lt;- [(),()..]] xsはモナドに包まったリストなので、fmapを使ってheadを持ち上げれば先頭要素がとれる。 x :: (Functor m, Monad m) =&gt; m () x = fmap head xs これをIdentityモナドとして動かしてみる。 &gt; runIdentity x ()よし！ Writerモナドとして動かしてみる。 &gt; runWriter (x :…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhiratara.hatenadiary.jp%2Fentry%2F20130518%2F1368862138&quot; title=&quot;fmap head VS sequence - Pixel Pedals of Tomakomai&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-05-18 16:28:58</published>
  <title>fmap head VS sequence</title>
  <type>rich</type>
  <url>https://hiratara.hatenadiary.jp/entry/20130518/1368862138</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
