Optional icon indicating copy to clipboard operation
Optional copied to clipboard

Is there a reccomended alternative since this project has not been updated since 2018?

Open jasikpark opened this issue 3 years ago • 9 comments

jasikpark avatar Mar 13 '21 21:03 jasikpark

Hi,

My assumption is that most people will be content with "just" nullable reference types, unless explicitly seeking a more functional approach.

Optional should still be useful as-is, although lacking a bit of ergonomics in some areas. The develop branch addresses some of this and adds nullability annotations and better async support, but some work is still needed to stabilize it fully (particularly on the test suite) - contributions there would be greatly appreciated.

Best regards, Nils

nlkl avatar Mar 13 '21 21:03 nlkl

Thanks for the response 👍

jasikpark avatar Mar 13 '21 21:03 jasikpark

Hi @nlkl! The only problem I'm seeing is that there are use cases that aren't covered yet, to my knowledge. For instance, how do we do await optional.MatchSome(async x => SomeTask(x))?

I'm usually having problems finding async counterparts of the usual methods.

I really hope you could keep up the good work here. I'm using your library extensively!

SuperJMN avatar Jun 02 '21 10:06 SuperJMN

@SuperJMN If you're willing you can try out my fork called Ultimately (https://github.com/silkfire/Ultimately). The set of async methods can be extended based on popular feedback. The library could improve a bit on the documenation side but let me know if you need help with anything.

silkfire avatar Jun 02 '21 10:06 silkfire

Wow, it looks nice. I'm currently using https://github.com/vkhorikov/CSharpFunctionalExtensions, too.

My goal is to have a library that has proper Maybe and Either types. I really like the library below. I find myself using the Result type a lot. The extension methods it has are pretty handy. Maybe you can get ideas from there or even merge this library that project.

Thanks!

SuperJMN avatar Jun 02 '21 11:06 SuperJMN

Feel free to add suggestions as issues on the repository page. I'll take a look at that library when I get some time.

silkfire avatar Jun 02 '21 11:06 silkfire

Can I just point out https://github.com/louthy/language-ext as an alternative that is still being heavily updated.

GlennStartin avatar Nov 16 '21 16:11 GlennStartin

I forked this repository and added features that I needed, such as:

  • Nullable reference types support
  • annotation of code with attributes that improves static analysis: Pure and JetBrains.Annotations
  • allocation reducing
  • Option<> and Option<,> now readonly structs
  • async analogs on OptionCollectionExtensions
  • MaxByOrNone() MinByOrNone() methods
  • other minor improvments

NuGet

pepelev avatar Oct 13 '23 12:10 pepelev

I forked this repository and added features that I needed, such as:

* [Nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references) support

* annotation of code with attributes that improves static analysis: [Pure](https://learn.microsoft.com/dotnet/api/system.diagnostics.contracts.pureattribute) and [JetBrains.Annotations](https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html)

* allocation reducing

* `Option<>` and `Option<,>` now readonly structs

* async analogs on `OptionCollectionExtensions`

* `MaxByOrNone()` `MinByOrNone()` methods

* other minor improvments

NuGet

I am open to contributions, so if you are interested in upstreaming your work, feel free to rebase it onto the develop branch and submit a PR.

nlkl avatar Oct 13 '23 15:10 nlkl