Add mapMG to allow making ModuleGraph abstract
authorBartosz Nitka <niteria@gmail.com>
Wed, 14 Jun 2017 15:51:43 +0000 (08:51 -0700)
committerBartosz Nitka <niteria@gmail.com>
Wed, 14 Jun 2017 15:52:02 +0000 (08:52 -0700)
commit430137c45420153dafbd448b4d509f893fe675f4
treeb9617ce14ab664ef1991f73b0044646b0770cb0c
parentece39c34b7846647441251fe72654f70cdf4a9a4
Add mapMG to allow making ModuleGraph abstract

Currently GHC exposes the internal details of `ModuleGraph`
which inhibits making `ModuleGraph` support faster lookups.

Haddock relies on the internal representation by using `map`
on `ModuleGraph`. See also
https://github.com/haskell/haddock/issues/635

Adding `mapMG` should allow us to make `ModuleGraph` abstract.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari, alexbiehl

Reviewed By: bgamari, alexbiehl

Subscribers: alexbiehl, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3645
compiler/main/GHC.hs
compiler/main/HscTypes.hs