-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Maybe in c#8. #3
Comments
That is a good question. I'll start with the bad news first. I've moved on to Swift development as of about 3 months ago. That means most of my C# projects will start to collect a serious layer of dust. But I like this question. I took a quick look at how C# 8 is going to implement nullable reference types, and I must say that I'm not impressed. Microsoft seems to be playing it safe and not angering anyone, except the people who would like to see the language grow into something more than it currently is. That being said, I would recommend always going with the built in way of doing it when that way covers the basics well enough. This gives you the advantage of using a technology that present and future team members will either already know, or can pick up fairly quickly. And when they gain experience using this built in technique they can use that experience in future projects. I'd suggest copying the SpicyTaco.Maybe code into your project and as you adopt C# 8 see where Maybe fits in. It might go away completely. It might wrap C# 8's option type (I couldn't find where the type is called out, if it exists). It might grow to support it using some new extension methods. I'm not sure. But you'll be much better served by having the code local to your project. And I can guarantee that this repository won't see any updates in the near to long term. I'm actually going to set a reminder to archive some of my old C# repos so that others will know not to depend on them heavily. Thank you for the thought provoking question! |
Thanks for reply and clarification. I run the test and it pass successfully. Trying to resolve these warning, I had to define the constraint
After more reading for c#8 null reference type, I think the goal of Maybe doesn't conflict with c#8:
In my opinion CLR isn't aware if the code compiled with c#8 or not. In my opinion |
That's interesting. Interesting enough that I setup Dotnet Core 3.0 and Visual Studio Code on my Mac. But I ran into a lot of issues and a big learning curve migrating the code to dotnet standard. I was able to work past a lot of them. I have the code building and running tests from the command line. All of that took me a couple of hours to get done today. I don't want to devote any more time to it at the moment. I may pick it up again in the future, but I don't want to make any promises. The branch I was working on was dotnet-standard. |
c# 8 is considering reference type isn't null by default and now there are two different ways for handling null reference types: Maybe and c#8.
What's the recommendation of using Maybe in c# 8.
Is there a plan for porting the library to be compiled with c# 8 support.
The text was updated successfully, but these errors were encountered: