<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gothedistance</author_name>
  <author_url>https://blog.hatena.ne.jp/gothedistance/</author_url>
  <blog_title>Life is Really Short, Have Your Life!!</blog_title>
  <blog_url>https://aroundthedistance.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Scala</anon>
  </categories>
  <description>関数型言語では宣言的な関数を用いることが推奨されるのでループで++みたいな手続きをそのまま書くのはノットソークールだと。慣れたら再帰で書くほうが直感的になる感、チョットわかった。 def sumList(list:List[Int]): Int = { list match { case Nil =&gt; 0 case x::list =&gt; x + sumList(list) } } これが全然理解できなかったんですよ。特にここが。 case x::list =&gt; x + sumList(list) この再帰を抜けるためにはsumlistで指定されたリストがNilになるしかない。つまり、再帰で呼び…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faroundthedistance.hatenadiary.jp%2Fentry%2F2015%2F06%2F19%2F165441&quot; title=&quot;Scalaの総数を取得する再帰呼び出し - Life is Really Short, Have Your Life!!&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>2015-06-19 16:54:41</published>
  <title>Scalaの総数を取得する再帰呼び出し</title>
  <type>rich</type>
  <url>https://aroundthedistance.hatenadiary.jp/entry/2015/06/19/165441</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
