summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-02-09 13:46:29 -0600
committerAustin Seipp <austin@well-typed.com>2015-02-09 21:07:26 -0600
commitd5a80dbe2ea03099c085020142528fcd39059a27 (patch)
treedabf0108e003e044f53269bca045ef728aef44be
parenta1db53cc6ea03d80f097c550bae277141b03ac30 (diff)
downloadhaskell-d5a80dbe2ea03099c085020142528fcd39059a27.tar.gz
Add Uniquable instances for InstalledPackageId/SourcePackageId/PackageName
Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D633
-rw-r--r--compiler/main/PackageConfig.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs
index b94ea65a65..3c41151c11 100644
--- a/compiler/main/PackageConfig.hs
+++ b/compiler/main/PackageConfig.hs
@@ -34,6 +34,7 @@ import Data.Version
import FastString
import Outputable
import Module
+import Unique
-- -----------------------------------------------------------------------------
-- Our PackageConfig type is the InstalledPackageInfo from bin-package-db,
@@ -66,6 +67,15 @@ instance BinaryStringRep PackageName where
fromStringRep = PackageName . mkFastStringByteString
toStringRep (PackageName s) = fastStringToByteString s
+instance Uniquable InstalledPackageId where
+ getUnique (InstalledPackageId n) = getUnique n
+
+instance Uniquable SourcePackageId where
+ getUnique (SourcePackageId n) = getUnique n
+
+instance Uniquable PackageName where
+ getUnique (PackageName n) = getUnique n
+
instance Outputable InstalledPackageId where
ppr (InstalledPackageId str) = ftext str