summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-11-11 10:49:44 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-11 10:53:22 +0100
commit96621b1b4979f449e873513e9de8d806257c9493 (patch)
treea8c3080fc878d0139256467d6f854586083df602 /compiler/iface
parent3cfe60aebb9de2a1d897a111f779eacb6614b7cc (diff)
downloadhaskell-96621b1b4979f449e873513e9de8d806257c9493.tar.gz
Associate pattern synonyms with types in module exports
This patch implements #10653. It adds the ability to bundle pattern synonyms with type constructors in export lists so that users can treat pattern synonyms more like data constructors. Updates haddock submodule. Test Plan: ./validate Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: simonpj, gridaphobe, thomie Differential Revision: https://phabricator.haskell.org/D1258 GHC Trac Issues: #10653
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/LoadIface.hs2
-rw-r--r--compiler/iface/MkIface.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index cbf8048db2..d2e16c67cb 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -908,7 +908,7 @@ When printing export lists, we print like this:
-}
pprExport :: IfaceExport -> SDoc
-pprExport (Avail n) = ppr n
+pprExport (Avail _ n) = ppr n
pprExport (AvailTC _ [] []) = Outputable.empty
pprExport (AvailTC n ns0 fs) = case ns0 of
(n':ns) | n==n' -> ppr n <> pp_export ns fs
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index b7bdc38ae5..d48d6e78fb 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -1080,7 +1080,7 @@ mkIfaceExports exports
= sortBy stableAvailCmp (map sort_subs exports)
where
sort_subs :: AvailInfo -> AvailInfo
- sort_subs (Avail n) = Avail n
+ sort_subs (Avail b n) = Avail b n
sort_subs (AvailTC n [] fs) = AvailTC n [] (sort_flds fs)
sort_subs (AvailTC n (m:ms) fs)
| n==m = AvailTC n (m:sortBy stableNameCmp ms) (sort_flds fs)