TruePath icon indicating copy to clipboard operation
TruePath copied to clipboard

Consider implementing `IComparable` in the path types

Open ForNeVeR opened this issue 1 year ago • 4 comments

This has hit me several times already: absence of IComparable<T> doesn't allow to use the type as a key in F#'s Map.

Let's define the comparability somehow.

ForNeVeR avatar Jul 31 '24 20:07 ForNeVeR

Hi. I would to implement this feature. Will we be OS dependent or will we always compare case-sensitive?

babaruh avatar Aug 26 '24 07:08 babaruh

Let's implement it as string comparison for now. A PR with more comparers is cooking: #84

My view is that we should use the PlatformDefaultPathComparer for default comparison (fast and IO-free, while providing good quality for most cases), and the user is free to use any other in case they want.

ForNeVeR avatar Aug 26 '24 10:08 ForNeVeR

I kinda don't want to add using System.Runtime.InteropServices to Absolute and Local paths to make comparing platform dependent Looks like #84 is almost done, so I'd prefer to finish it and then add IComparable<>

Should I fork #84 to finish it?

babaruh avatar Sep 01 '24 10:09 babaruh

Sure, you can fork and finish it. Just make sure to preserve the original contributor's commit, to preserve their authorship for the history and proper acknowledgment.

ForNeVeR avatar Sep 01 '24 11:09 ForNeVeR