Skip to content

Instantly share code, notes, and snippets.

@otf
Created February 25, 2012 04:38
Show Gist options
  • Save otf/1906490 to your computer and use it in GitHub Desktop.
Save otf/1906490 to your computer and use it in GitHub Desktop.
[Test]
public void Eitherに関数を適用_途中で失敗する関数()
{
var safeParse = FuncUtil.Either<string, int>(int.Parse);
var m = (Either<Exception, string>)Either.Right("hoge");
var result = from result1 in m
from result2 in safeParse(result1)
select result2;
Assert.That(result.Match(l => true, r => false), Is.True);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment