DigitecGalaxus / Galaxus.Functional

A package bringing popular functional abstractions (e.g. Option or Result) to C#.
Other
37 stars 12 forks source link

Helper methods and method helpers #3

Closed phkiener closed 3 years ago

phkiener commented 4 years ago

Right now, the package is mostly focused on Option, Result and Either. It'd be nice to include some miscellaneous functions to ease working with lambdas everywhere...

And because of the beauty that is functional programming, the types should be enough to explain what the functions should do.

FreeApophis commented 4 years ago

Hey, former digitec employee here, great effort you put into your open source libraries. We at @messerli-informatik-ag, where I am currently CTO, have built a very very similar and fast growing library: Funcky

We already have Flip, Curry, Identity, NoOp ... etc.

We also try to add API to the .NET Standard Library which promotes the functional programming style e.g.:

We also try to make the different Monads like Option<T> IEnumerable<T> (linq syntax) Task<T> (await) Lazy<T> work nicely together.

With Funcky you can do this:

var date = 
    from year in yearString.TryParseInt()
    from month in monthString.TryParseInt()
    from day in dayString.TryParseInt()
    select new DateTime(year, month, day)

We would like to invite you to take a look if the library could offer you something, or even combine our efforts. Because we know how much work it is and we also think ideas need to be challenged to become great.

phkiener commented 3 years ago

This issue has been open for quite some time, and I've had quite some time to think about it.

While I did open a PR, I have closed it now. With how the library currently is, these helpers would stand out like a sore thumb.. a whole new concept to be introduced.

For now, I'll close this issue. Maybe some time in the future we'll introduce all this fancy stuff, but for now - let's keep it at Option, Result and Either.