{"published":"2007-10-02 23:40:36","description":"\"Foundations of F#\" \u306b\u306f \"union type\" \u3063\u3066\u66f8\u3044\u3066\u3042\u308b\u3093\u3060\u3051\u3069\u3001\u65e5\u672c\u8a9e\u8a33\u3059\u308b\u3068\u4f55\u306b\u306a\u308b\u3093\u3060\u308d\u3046\uff1f (* \u30b8\u30e3\u30f3\u30b1\u30f3\u578b \u5217\u6319\u578b\uff08enum\uff09\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3067\u304d\u308b *) type Janken = Goo | Choki | Pah let janken = Choki printfn \"%A\" janken // \"Choki\" \u3068\u8868\u793a (* Janken \u578b\u306e\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0 *) let jankenPon a b = match (a, b) with | (Goo, Choki) | (Choki, Pah) | (Pah, Goo) -> \"win\" | \u2026","categories":["programming","F#"],"blog_title":"\u30ab\u30bf\u30c1\u3065\u304f\u308a","provider_name":"Hatena Blog","type":"rich","title":"union type (F#)","width":"100%","height":"190","author_url":"https://blog.hatena.ne.jp/u_1roh/","url":"https://u-1roh.hatenadiary.org/entry/20071002/1191336036","author_name":"u_1roh","blog_url":"https://u-1roh.hatenadiary.org/","image_url":null,"version":"1.0","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fu-1roh.hatenadiary.org%2Fentry%2F20071002%2F1191336036\" title=\"union type (F#) - \u30ab\u30bf\u30c1\u3065\u304f\u308a\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}