[commit: ghc] master: Add Uniquable instances for InstalledPackageId/SourcePackageId/PackageName (d5a80db)

git at git.haskell.org git at git.haskell.org
Tue Feb 10 14:01:48 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d5a80dbe2ea03099c085020142528fcd39059a27/ghc

>---------------------------------------------------------------

commit d5a80dbe2ea03099c085020142528fcd39059a27
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Feb 9 13:46:29 2015 -0600

    Add Uniquable instances for InstalledPackageId/SourcePackageId/PackageName
    
    Summary: Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D633


>---------------------------------------------------------------

d5a80dbe2ea03099c085020142528fcd39059a27
 compiler/main/PackageConfig.hs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs
index b94ea65..3c41151 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
 



More information about the ghc-commits mailing list