Skip to content
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

Optional.Collection nuget package v.1.1.0 misses Values and Exceptions extension methods #45

Closed
manuel-ornato opened this issue Nov 24, 2017 · 2 comments

Comments

@manuel-ornato
Copy link

Hi,

It seems Optional.Collection misses Values and Exceptions extension methods in Nuget package 1.1.0.

By the way, I was wondering what is the best way of accessing the Exception property of an Option<T,TException>?
Is it opt.Match(v => Option.None<TException>(), ex => ex.Some())?
Maybe an extension method (ToException ?) that does that would be a fine addition to the lib.
An ExceptionOrFailure in unsafe might also be provided.

I have to say this lib changed my programmer's life! Thanks a lot for your work.

Manuel

@nlkl
Copy link
Owner

nlkl commented Dec 17, 2017

Hi Manuel,

Thank you for the nice words and your interest in the project.

Regarding the .Values() and .Exceptions() extension methods, these are not included in Optional.Collections, but part of the upcoming v4 release, which directly includes the most important functionality from Optional.Collections (which in turn will not be supported in the future). You can grab the pre-release on Nuget - I have been using it for some time already without any problems, so it should be rather stable (and will be fully released in the not-too-distant future).

Currently, .Match(...) is the preferred way to get the exceptional value. I am, however, always considering ways improve usability of the library, and streamlining the ways in which you can work with exceptional values is definitely on the roadmap.

Have a great day.

Best regards,
/ Nils

@nlkl
Copy link
Owner

nlkl commented Dec 17, 2017

(also see #47 )

@nlkl nlkl closed this as completed Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants