Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I've seen a Java version of this technique before, but lambdas and named parameters make it so much readable. +1! Commented Feb 7, 2014 at 18:37
  • 1
    I think the problem here is that Right isn't generic over the type of error. Something like: class Right<R> : Either<Bot,R>, where Either is changed to an interface with covariant (out) type parameters, and Bot is the bottom type (subtype of every other type, opposite of Object). I don't think C# has a bottom type. Commented Feb 24, 2015 at 16:33