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

Implicit boxing operator from T to Maybe<T> #2

Merged
merged 1 commit into from
Jul 22, 2015

Conversation

radiosterne
Copy link

I've added implicit boxing operator to Maybe for following reasons:

  1. It allows simple collection creation with initializers —
var maybesList = new List<Maybe<int>>
            {
                1,
                2,
                3
            };

instead of

var maybesList = new List<Maybe<int>>
            {
                1.ToMaybe(),
                2.ToMaybe(,
                3.ToMaybe(
            };
  1. possible fix of bad R# hadling of Maybe (don't tested)

But then again, any implicit boxing is evil and possibly performance-striking, so do you have any thoughts on necessity of this feature? E.g. Scala Option type doesn't have implicit boxing out-of-the-box.

AndreyTsvetkov added a commit that referenced this pull request Jul 22, 2015
Implicit boxing operator from T to Maybe<T>
@AndreyTsvetkov AndreyTsvetkov merged commit 7daf660 into AndreyTsvetkov:master Jul 22, 2015
@radiosterne
Copy link
Author

Victory!

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

Successfully merging this pull request may close these issues.

2 participants