<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>OCaml</anon>
    <anon>型理論</anon>
    <anon>言語処理系</anon>
  </categories>
  <description>前回書いた通り、TaPL準拠の型推論が完全に純粋関数型なのに対して、「ユニークな型変数を作る」new_tvar関数に状態を持たせることでいちいち引数・返り値のタプルの一部として渡し回さなくてもいいようにする。 HaskellだったらStateモナドの出番なのだろうが、OCamlなので普通に破壊的代入でやってしまう。 今回のコード： gist.github.com 変更を加えたのはnew_tvar関数そのもの、大元のtypeof関数、そしてinfer関数の三箇所。unifyやapplysubstなどは元々new_tvarを触っていなかったので変更なし。 new_tvar before type …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2022%2F10%2F25%2F184723&quot; title=&quot;型推論を実装・改善していく４　状態を持つ型変数生成 - Arantium Maestum&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>2022-10-25 18:47:23</published>
  <title>型推論を実装・改善していく４　状態を持つ型変数生成</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2022/10/25/184723</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
