[commit: ghc] master: Simplify ghc-boot database representation with new type class. (0d60165)
git at git.haskell.org
git at git.haskell.org
Mon Feb 1 14:51:05 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0d601657ca6ec1812492bb16a7d0e181b370e2d8/ghc
>---------------------------------------------------------------
commit 0d601657ca6ec1812492bb16a7d0e181b370e2d8
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Mon Feb 1 14:31:49 2016 +0100
Simplify ghc-boot database representation with new type class.
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: Edward Z. Yang <ezyang at cs.stanford.edu>
Test Plan: validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1811
>---------------------------------------------------------------
0d601657ca6ec1812492bb16a7d0e181b370e2d8
compiler/basicTypes/Module.hs | 7 ++-
compiler/main/PackageConfig.hs | 26 +--------
compiler/main/Packages.hs | 10 +++-
libraries/ghc-boot/GHC/PackageDb.hs | 107 +++++++++++++++---------------------
utils/ghc-pkg/Main.hs | 48 +++++++++++-----
5 files changed, 93 insertions(+), 105 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0d601657ca6ec1812492bb16a7d0e181b370e2d8
More information about the ghc-commits
mailing list