Click here to Skip to main content
15,070,139 members
Articles / Programming Languages / C# 7.0

Tagged as

Stats

30.1K views
359 downloads
48 bookmarked

IResult - A Robust Option Type for C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (45 votes)
9 Jun 2017CPOL7 min read
An attempt to introduce some Functional Programming concepts into an OOP domain
In this article, I discuss IResult, which I created based on the concept of an Option (or Maybe) type from functional programming languages. IResult utilizes some of these new features of C# 7.0 to emulate an the Option type from F#, including helper functions like Bind, Map and Fold. I look at reading input, parsing input, IResult extension methods, and how to put it all together.

Views

Downloads

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jeremy Madden
Software Developer
United States United States
I started my dev career writing in a custom port of PL/1 for 4 years.

Now I'm an enterprise C# developer in Portland, OR.

I think I'll stick with C#.

Comments and Discussions