Skip to content

Commit

Permalink
Clarify sorting haddocks for Ord ProjectConfigPath
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 11, 2024
1 parent 8671035 commit 06b9d44
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06b9d44

Please sign in to comment.