<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>osiire</author_name>
  <author_url>https://blog.hatena.ne.jp/osiire/</author_url>
  <blog_title>osiire’s blog</blog_title>
  <blog_url>https://osiire.hatenablog.com/</blog_url>
  <categories>
    <anon>多相バリアント</anon>
  </categories>
  <description>前回までで多相バリアントの基本的な機能は説明してきました。そこで今回は、多相バリアントのとても重要な応用についてお話したいと思います。それは、場合分け構造の拡張問題です。 場合分け構造の拡張は難しい 例えば、次のようなコードがあったとします。 module Card = struct type t = Num of int | Jack | Queen | King let num = function Num i -&gt; i | Jack -&gt; 11 | Queen -&gt; 12 | King -&gt; 13 end Card.tには4種類の場合分けがあり、それらに対してnumという操作が定義されて…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fosiire.hatenablog.com%2Fentry%2F20090516%2F1242456737&quot; title=&quot;多相バリアントを使いこなそう(4) - osiire’s blog&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>2009-05-16 15:52:17</published>
  <title>多相バリアントを使いこなそう(4)</title>
  <type>rich</type>
  <url>https://osiire.hatenablog.com/entry/20090516/1242456737</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
