ForNeVeR / TruePath

File path abstraction library for .NET.
https://www.nuget.org/packages/TruePath
MIT License
52 stars 9 forks source link

Consider implementing `IComparable` in the path types #87

Open ForNeVeR opened 1 month ago

ForNeVeR commented 1 month ago

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.

babaruh commented 3 weeks ago

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

ForNeVeR commented 3 weeks ago

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.

babaruh commented 2 weeks ago

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?

ForNeVeR commented 2 weeks ago

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.