Accessing the "original" names via GHC API

Ranjit Jhala jhala at cs.ucsd.edu
Wed Jan 25 00:09:04 UTC 2017


Hi,

I'm quite vexed trying to do the following. Suppose I have a file:

```
module Foo

import qualified Data.Set as S

baz :: S.Set Int
baz = S.empty
```

My goal is to write a function

   tyconString :: TyCon -> String

(perhaps with extra parameters) such that given the
`TyCon` corresponding to `Set`, I get back the "original"
name `S.Set`, or even `Data.Set.Set`.

Everything I've tried, which is fiddling with different variants of
`PprStyle`, end up giving me `Data.Set.Base.Set`

Does anyone have a suggestion for how to proceed?

Thanks!

- Ranjit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20170124/67632984/attachment.html>


More information about the Glasgow-haskell-users mailing list