<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>susisu</author_name>
  <author_url>https://blog.hatena.ne.jp/susisu/</author_url>
  <blog_title>Object.create(null)</blog_title>
  <blog_url>https://susisu.hatenablog.com/</blog_url>
  <categories>
    <anon>TypeScript</anon>
    <anon>プログラミング</anon>
    <anon>小ネタ</anon>
  </categories>
  <description>TypeScript で Haskell にあるような GADT (Generalized Algebraic Data Type) っぽいものをどう表現できるかという話. GADT を使いたくなる例 式をデータとして表現したいことありますよね. あると言ってくれ. 例えば数値と数値上の関数, そして関数適用がある式を考えます. 素朴に表現すると以下のようになるでしょう. type Expr = | { type: &quot;num&quot;, val: number } | { type: &quot;fun&quot;, val: Fun } | { type: &quot;app&quot;, fun: Expr, arg: Expr }; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsusisu.hatenablog.com%2Fentry%2F2020%2F05%2F03%2F020854&quot; title=&quot;TypeScript で GADT っぽいの - Object.create(null)&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>2020-05-03 02:08:54</published>
  <title>TypeScript で GADT っぽいの</title>
  <type>rich</type>
  <url>https://susisu.hatenablog.com/entry/2020/05/03/020854</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
