Closed kleidemos closed 4 years ago
Thanks for the PR, but I think I won't be merging this for the following reasons:
.GetAllResults()
would be getting called every time a comparison is made..GetAllResults()
manually and comparing the results.additional constraints
. It adds structural equality and comparison if the generic paramter has them. Like obj list
and int list
.
With these attributes,
MyBox<A>
will only satisfy the equality and comparison constraints ifA
satisfies these constraints. You will still be able to useMyBox<_>
with any type.
ParseResults<_>
is not comparable. In any case we can make it lazy
.Arugments
with ParseResults<_>
(even in only one case), I must manually write comparison for all cases.Fair enough. Can revisit if you could cache the result for comparison purposes and add a few tests.
Thanks
I had problem when I added a subcommand case to
Arguments
. Because DU containingParseResults<_>
loses structural equality and comparison. I think comparing aParseResults<_>
byGetAllResults
is a good idea.Safer Code: Declaring Conditions for Equality over Container Types
in https://blogs.msdn.microsoft.com/dsyme/2009/11/08/equality-and-comparison-constraints-in-f/