<?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>今回からHindley Milner型推論の要であるLet多相を実装していく。 これまで見てきた型推論は単相な関数しか扱えなかった。例えばこのようなコードはOCamlでは通る： utop # let id x = x = x in id 1 &amp;&amp; id &quot;hello&quot;;; - : bool = true しかし単相的な型推論では通らない（そもそも整数型も文字列型もないことには目を瞑るとしても）。何故ならid 1について推論した時点でidの型はint -&gt; intだと推論されて、その次のid &quot;hello&quot;で型が合致しないと判定されるからだ。 OCamlでもこんなコードは通らない： utop #…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2022%2F10%2F28%2F191026&quot; title=&quot;型推論を実装・改善していく７　Let多相型推論（前編） - 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-28 19:10:26</published>
  <title>型推論を実装・改善していく７　Let多相型推論（前編）</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2022/10/28/191026</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
