Skip to content

Instantly share code, notes, and snippets.

@otf
Created February 25, 2012 03:04
Show Gist options
  • Save otf/1905589 to your computer and use it in GitHub Desktop.
Save otf/1905589 to your computer and use it in GitHub Desktop.
[Test]
public void Maybe関数()
{
var safeParse = FuncUtil.Maybe<string, int>(int.Parse);
Assert.That(safeParse("123"), Is.EqualTo(new Option<int>(123)));
Assert.That(safeParse("ababa"), Is.EqualTo(Option<int>.None));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment