<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>blanketsky</author_name>
  <author_url>https://blog.hatena.ne.jp/blanketsky/</author_url>
  <blog_title>blanket log</blog_title>
  <blog_url>https://blanketsky.hatenadiary.org/</blog_url>
  <categories>
    <anon>Haskell</anon>
  </categories>
  <description>たとえばある関数 f が単調増加することが分かっている場合、 sum [ a | x &lt;- [1..], let a = f x, a &lt; m ] みたいに書いて、m 未満の f(x) の和を計算したいのです。もちろんこのコードは止まりません。処理系は関数が単調増加だなんて知る由もないのですから。この例のような場合は takeWhile や dropWhile を使って sum $ takeWhile (&lt; m) [ a | x &lt;- [1..], let a = f x ] と書けます。m との比較をリスト内包の外に移しただけです。大抵の場合はこれで済むのですが、打ち切るかどうかの判断をリス…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblanketsky.hatenadiary.org%2Fentry%2F20080618%2F1213755338&quot; title=&quot; 無限リストを途中で打ち切りたい - blanket log&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>2008-06-18 11:15:38</published>
  <title> 無限リストを途中で打ち切りたい</title>
  <type>rich</type>
  <url>https://blanketsky.hatenadiary.org/entry/20080618/1213755338</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
