diff --git a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs index 80484148224..25de1091d66 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs @@ -51,7 +51,13 @@ import Distribution.Simple.Utils (ordNub) newtype ProjectConfigPath = ProjectConfigPath (NonEmpty FilePath) deriving (Eq, Show, Generic) --- | Sorts URIs after local paths and longer paths after shorter ones. +-- | Sorts URIs after local file paths and longer file paths after shorter ones +-- as measured by the number of path segments. If still equal, then sorting is +-- lexical. +-- +-- The project itself, a single element root path, compared to any of the +-- configuration paths it imports, should always sort first. Comparing one +-- project root path against another is done lexically. instance Ord ProjectConfigPath where compare pa@(ProjectConfigPath (NE.toList -> as)) pb@(ProjectConfigPath (NE.toList -> bs)) = case (as, bs) of