louthy / language-ext

C# functional language extensions - a base class library for functional programming
MIT License
6.42k stars 416 forks source link

Identify and Fix Issue with Error Monoid Implementation #1376

Open micmarsh opened 1 day ago

micmarsh commented 1 day ago

I noticed that the Errors Combine method always returns a ManyErrors, even if you're concatenating a single error and an Empty error. This violates the identity monoid laws (assuming we want to use == rather than Error.Is to determine Error equality, which may not be true) in addition to just feeling like a bug, at least to me.

Obviously, if this was intended or is fine, please disregard!