<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuroyoro</author_name>
  <author_url>https://blog.hatena.ne.jp/yuroyoro/</author_url>
  <blog_title>( ꒪⌓꒪) ゆるよろ日記</blog_title>
  <blog_url>https://yuroyoro.hatenablog.com/</blog_url>
  <categories>
    <anon>scala</anon>
  </categories>
  <description>Scalaには、PartialFunctionというものがあります。 直訳すると部分関数ですが、これはなにかっていうと「特定の引数に対しては結果を返すけど、結果を返せない引数もあるような中途半端な関数」です。 どうやって使うのん? まぁ、ちょっと例を見てましょうや。PartialFunctionであるfooPfは、引数が&quot;foo&quot;だったら&quot;bar&quot;を返して、&quot;foo&quot;以外は知らんというてきとーな関数です。 scala&gt; val fooPf:PartialFunction[String,String] = { case &quot;foo&quot; =&gt; &quot;bar&quot; } fooPf: PartialFunctio…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyuroyoro.hatenablog.com%2Fentry%2F20100705%2F1278328898&quot; title=&quot;ScalaのPartialFunctionが便利ですよ - ( ꒪⌓꒪) ゆるよろ日記&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>2010-07-05 20:21:38</published>
  <title>ScalaのPartialFunctionが便利ですよ</title>
  <type>rich</type>
  <url>https://yuroyoro.hatenablog.com/entry/20100705/1278328898</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
