• Edward Z. Yang's avatar
    Simplify ghc-boot database representation with new type class. · 0d601657
    Edward Z. Yang authored
    Previously, we had an 'OriginalModule' type in ghc-boot which
    was basically identical to 'Module', and we had to do a bit of
    gyrating to get it converted into the right form.  This commit
    introduces a new typeclass, 'DbModuleRep' which represents types
    which we know how to serialize to and from the (now renamed) 'DbModule'
    type.
    
    The upshot is that we can just store 'Module's DIRECTLY in
    the 'InstalledPackageInfo', no conversion needed.
    
    I took the opportunity to clean up ghc-pkg to make its use of
    the 'BinaryStringRep' classes more type safe.
    Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1811
    0d601657
Packages.hs 62.7 KB