[GHC] #12390: List rules for `Coercible` instances
GHC
ghc-devs at haskell.org
Sun Jun 11 23:53:40 UTC 2017
#12390: List rules for `Coercible` instances
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: tellah
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: ghci059
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3634
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
Here are some design notes off the top of my head:
I don't want to clutter `TyThing` with this, as it's unclear where within
`TyThing` the documentation should go. In `TyCon`? Perhaps, but I don't
love it.
Instead, `InteractiveEval.getInfo` could return 5 things instead of 4; the
fifth is an `SDoc` with extra text that should be printed. (It would
normally be `empty`.) Naturally, you will have to add the fifth return
value to `HscMain.hscTcRnGetInfo` and `TcRnDriver.tcRnGetInfo`. That last
function can just call a new `lookupCustomDoc` function. That function can
be defined in `PrelInfo`; it would refer to a `UniqFM SDoc` that
associates `Unique`s with `SDoc`s. The `SDoc`s could (for now) just be
hard-coded in `PrelInfo`. Certainly baked-in goodies other than
`Coercible` can benefit from this new behavior. Perhaps it would be better
to store the printed strings outside of a Haskell source file, but we
don't have to over-design to begin with.
Before implementing this, @tellah, perhaps someone else who is not a
newcomer can opine on my design choices here. And, thanks!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12390#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list