{"published":"2010-10-14 16:07:05","blog_url":"https://faithandbrave.hateblo.jp/","blog_title":"Faith and Brave - C++\u3067\u904a\u307c\u3046","provider_name":"Hatena Blog","type":"rich","title":" Either","version":"1.0","author_name":"faith_and_brave","categories":["Scala"],"width":"100%","description":"Scala\u306b\u3082Either\u3042\u3063\u305f\u3093\u3060\u306a\u3001\u3068\u3002 object Main { def foo(x : Int) : Either[String, Int] = x match { case 0 => Left(\"invalid arguments!\") case _ => Right(x) } def result(a : Either[String, Int]) : Unit = a match { case Left(msg) => println(\"Error : \" + msg) case Right(x) => println(x) } def main(args: Array[Stri\u2026","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F20101014%2F1287040025\" title=\" Either - Faith and Brave - C++\u3067\u904a\u307c\u3046\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/faith_and_brave/","image_url":null,"url":"https://faithandbrave.hateblo.jp/entry/20101014/1287040025","height":"190"}