<?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>Data.List に unfoldr という関数が定義されています。どういう使い道なのだろうと思ったのですが、数を2進数文字列に変換できるのではないかと思いやってみました。 Data.Listの例 --A simple use of unfoldr: unfoldr (\b -&gt; if b == 0 then Nothing else Just (b, b-1)) 10 -- &gt; [10,9,8,7,6,5,4,3,2,1] 2進数文字列を作ってみます。 &gt; :t unfoldr unfoldr :: (b -&gt; Maybe (a, b)) -&gt; b -&gt; [a] - ループが終了するときは…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsirocco.hatenadiary.org%2Fentry%2F20130416%2F1366121105&quot; title=&quot;unfoldr を使って2進数文字列を作る - 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>2013-04-16 23:05:05</published>
  <title>unfoldr を使って2進数文字列を作る</title>
  <type>rich</type>
  <url>https://sirocco.hatenadiary.org/entry/20130416/1366121105</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
