Add namePackage function to template-haskell
authorRyanGlScott <ryan.gl.scott@gmail.com>
Thu, 17 Sep 2015 21:15:26 +0000 (23:15 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Thu, 17 Sep 2015 21:15:42 +0000 (23:15 +0200)
commit77662e13a510ddbc89fea00785e99f5f4d3a2b25
tree177586bff2fb04eca1ea422dd146656e3d3d8a92
parent8ecf6d8f7dfee9e5b1844cd196f83f00f3b6b879
Add namePackage function to template-haskell

Currently there exists a nameBase function (for retrieving a Name's OccName)
and a nameModule function (for retrieving a Name's ModName), but there is no
counterpart for PkgNames.

This would be useful for implementing Template Haskell features which need
to have easy access to a Name's package (e.g., automatically derived Lift
instances).

Reviewed By: goldfire, austin, thomie

Differential Revision: https://phabricator.haskell.org/D1237
libraries/template-haskell/Language/Haskell/TH.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/changelog.md
testsuite/tests/th/TH_namePackage.hs [new file with mode: 0644]
testsuite/tests/th/TH_namePackage.stdout [new file with mode: 0644]
testsuite/tests/th/all.T