<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>E_Mattsan</author_name>
  <author_url>https://blog.hatena.ne.jp/E_Mattsan/</author_url>
  <blog_title>エンジニアのソフトウェア的愛情</blog_title>
  <blog_url>https://blog.emattsan.org/</blog_url>
  <categories>
    <anon>Elixir</anon>
    <anon>Ruby</anon>
  </categories>
  <description>特定の値から出発して演算を繰り返し値の並びを出力する unfold 。 そういえば Ruby に unfold ってないんだっけ？ というのが発端。 unfold とは 早い話が fold の逆です。 Elixir では Stream.unfold/2 が定義されています。 # 1 から始めて、前の値に 1 を加える Stream.unfold(1, fn x -&gt; {x, x + 1} end) |&gt; Enum.take(10) #=&gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # 1 から始めて、前の値を 2 倍にする Stream.unfold(1, fn x -&gt;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.emattsan.org%2Fentry%2F2024%2F12%2F31%2F060000&quot; title=&quot;Rubyでunfoldを書く - エンジニアのソフトウェア的愛情&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>https://cdn.user.blog.st-hatena.com/default_entry_og_image/401695/1514192717173017</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-12-31 06:00:00</published>
  <title>Rubyでunfoldを書く</title>
  <type>rich</type>
  <url>https://blog.emattsan.org/entry/2024/12/31/060000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
