[GHC] #7730: :info and polykinds
GHC
ghc-devs at haskell.org
Fri May 9 13:05:04 UTC 2014
#7730: :info and polykinds
--------------------------------------------+------------------------------
Reporter: monoidal | Owner: archblob
Type: bug | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler (Type checker) | Version: 7.6.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets: #8776
--------------------------------------------+------------------------------
Comment (by simonpj):
Simon is right about `ifConOcc`. Good point.
Rather than pass in the `Name` of the type constructor, you could simply
pass in the `Module` in which this `IfaceDecl` lives. Then you can easily
make a `Name` for all of these things. It's bit of a nuisance, but
perhaps better than making them all `IfaceExtNames`. Perhaps pass in a
`Maybe Module`, where `Nothing` means "just print the `OccName`"?
> @simonmar suggestion would be easier because we already pass a name to
{{{pprIfaceDecl}}} in order to print things in context and elide
everything not searched for
Not exactly. We pass in a `ShowSub` (or that's what it used to be called
in `PprTyThing`. So yes, `ShowSub` could be augmented with that `Maybe
Module` and then it is already being plumbed to all the right places.
The TH route is certainly a plausible alternative; a good thought. As I
say above, I'm not wedded to doing all this via `IfaceSyn`. And better
printing for TH stuff would be good; perhaps even better than better
printing for Iface stuff (which only hard-core people will look at).
The place to look is `TcSplice.reifyThing` which is the moral equivalent
of `MkIface.tyThingToIfaceDecl`. You'll see that `reifyThing` is monadic,
but the only reason for that is that it can fail, if TH syntax isn't rich
enough to deal with the result. Arguably it'd be good to remove the
possibility of failure, and thereby force ourselves to enhance TH syntax
to cope.
I notice also that `reifyThing` is not doing the requisite tidying (which
`tyThingToIfaceDecl` is careful to do) so I think there are lurking bugs
there.
But (and I have not got time to think this through right now), TH syntax
models source syntax, and so doesn't have explicit kinds, whereas Iface
syntax does....
Probably worth completing the Iface route for now.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7730#comment:41>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list