<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sirocco</author_name>
  <author_url>https://blog.hatena.ne.jp/sirocco/</author_url>
  <blog_title>sirocco の書いてもすぐに忘れるメモ</blog_title>
  <blog_url>https://sirocco.hatenadiary.org/</blog_url>
  <categories>
    <anon>Haskell</anon>
  </categories>
  <description>先に作った電卓のレジスタのように Haskell でも状態を保持しておきたいときがあります。 先の電卓ではIORefを使ってレジスタの状態を保持しました。 IORef &gt; :m + Data.IORef &gt; do{ x &lt;- newIORef 1; modifyIORef x (+2); ret &lt;-readIORef x; return ret} -- =&gt; 3 &gt; :t do{ x &lt;- newIORef 1;modifyIORef x (+2);ret &lt;-readIORef x;return ret} do{ x &lt;- newIORef 1;modifyIORef x (+2);ret…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsirocco.hatenadiary.org%2Fentry%2F20120114%2F1326489188&quot; title=&quot;Haskell で変数を使う。(IORef、Stateモナド、STモナド) - sirocco の書いてもすぐに忘れるメモ&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>2012-01-14 06:13:08</published>
  <title>Haskell で変数を使う。(IORef、Stateモナド、STモナド)</title>
  <type>rich</type>
  <url>https://sirocco.hatenadiary.org/entry/20120114/1326489188</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
