Skip to content

Commit 192446b

Browse files
committed
Add comment for Package newtype
1 parent 2329109 commit 192446b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ghcide/src/Development/IDE/Core/Dependencies.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ import System.FilePath ((<.>), (</>))
6363
- index project HIE files.
6464
-}
6565

66+
-- | We make this newtype only so that we can have an Ord
67+
-- instance. This gives us the convenience of being able
68+
-- to use a Package as the key in the Map packagesWithModules,
69+
-- and process the packages and their modules using the
70+
-- Map.traverseWithKey function.
6671
newtype Package = Package GHC.UnitInfo deriving Eq
6772
instance Ord Package where
6873
compare (Package u1) (Package u2) = compare (GHC.unitId u1) (GHC.unitId u2)

0 commit comments

Comments
 (0)