DigitecGalaxus / Galaxus.Functional

A package bringing popular functional abstractions (e.g. Option or Result) to C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract async-extensions into their own "module"

phkiener opened this issue · comments

Right now, there's a lot of extensions for Result, Option and Either to handle async. MatchAsync, UnwrapAsync and all that.. and it kind of feels like noise in the midst of other extension that actually provide new functionality.

I think we could generate these extensions with a source generator, but I'd like to keep that distinctly apart from the rest of the library. So - I'd like to have all async functionaliry extrated to a different project Galaxus.Functional.Async.

It would still be contained in the same solution - and would still be packaged. The nuget package would simply contain both DLLs, with one being mostly generated code I guess.

I like the idea very much. For me it doesn't matter if the extracted projects contain generated code or code written by hand, it would bundle together common concerns in either case.

After some discussions, we've extracted all async operations into extension methods, so they don't "pollute" the types directly. They're still in the same namespace, but at least they're isolated.

Maybe in the future we'll implement them via source generators, but let's keep it simple for now.