polyadic / funcky

Funcky is a Functional Library for C#
https://polyadic.github.io/funcky
Apache License 2.0
18 stars 3 forks source link

Adapting to changes in C#13 #792

Open FreeApophis opened 1 month ago

FreeApophis commented 1 month ago

C#13 has some new features which impact Funcky in a fundamental way: we probably want to introduce new API in a 3.x Version, but I think the old API should be phased out and removed in a 4.0 Release.

Changes which might impact Funcky:

params

Sequence.Return

implicit and explicit extensions

ParseExtensions could be static extensions to make the Parse*OrNone functions be visible on the type.

string.ParseInt32OrNone could be int.ParseOrNone()

We could make the Asserts more discoverable by statically extend Assert in XUnit:

Sequence could be entirely done as a static extension on Enumerable.

Some<T> some = option;
var value = some.GetOrThrow();

Let's collect the ideas for new features, adapted features and how to move on here.

FreeApophis commented 1 month ago

Ahh the official links are missing:

https://devblogs.microsoft.com/dotnet/dotnet-build-2024-announcements/#c-13 https://build.microsoft.com/en-US/sessions/689e5104-72e9-4d02-bb52-77676d1ec5bc?source=sessions

FreeApophis commented 1 month ago

AFAIK implementing interfaces is out of scope for C#13 but we could also look if the list pattern support of Option<T> could be extracted into an extension, since it relies on duck typing and not on an interface.

bash commented 1 month ago

I saw the presentation about extensions and got really excited about the possibilities for Funcky 🎉

I bet that we could also do some fun things with properties that we can't right now (i.e. have <Property>OrNone properties on System. objects that turn nullability into options.