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

IResult - A Robust Option Type for C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (48 votes)
9 Jun 2017CPOL7 min read 43.5K   387   50  
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.


Daily Counts


Weekly Counts


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

Written By
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