Hacker News new | ask | show | jobs
by snowcrshd 3389 days ago
Yeah, I was expecting something like what you get in F#.

But maybe it is just the nature of the [C#] language. Still, I think this looks more readable than if-statements.

EDIT: Maybe it is just a bad example of pattern matching, the one they put on that page. I'm betting pattern matching works on the added tuple type. That would be pretty handy.

2 comments

Didn't want to do this out of the gates, but now that I've started a discussion, and folks seem to agree, check out this library I'm working on.

https://github.com/Jagged/OneOf

I've got some more performance improvements and code cleanup in my stash RN I've not quite finished up yet.

Forgot to say earlier - Currently being distributed @ https://www.nuget.org/packages/DiscU
you're right; it's not (my other comment on this page: https://news.ycombinator.com/item?id=13835765)