[GHC] #9813: Error when reifying type constructor
GHC
ghc-devs at haskell.org
Thu Feb 11 15:42:02 UTC 2016
#9813: Error when reifying type constructor
-------------------------------------+-------------------------------------
Reporter: owst | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 7.8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1899
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
There's two separate questions at work here:
1. Is there a rule that humans can understand and apply easily telling
these humans what is available for reification at a certain splice?
2. Is the rule proposed in (1) implementable?
I'm worried about tackling (2) before nailing (1). It sounds like you're
suggesting a rule such as this:
A. All declarations appearing above a splice such that all dependencies
of the declaration are also above the splice are available.
I don't love this rule, because it takes declaration order into account in
a non-trivial way. Haskellers tend not to worry about top-to-bottom
ordering. (Of course, we already violate this convention with top-level
splices.) But maybe others like this rule and think it's easy enough.
But then what about
B. All declarations that do not depend on any splice are in scope for all
splices.
This is a different rule than the first. Is it easier to understand?
According to Simon's suggestion, we might consider
C. All types (as broken up by top-level splices) are available for all
splices, but functions are available only according to the top-to-bottom
rule around top-level splices.
I think any of these rules might be implementable. But what's best? Let's
settle on a design that can be simply stated and understood before
worrying about implementation. Another way of saying this: let's get our
brains dirty before we get our hands dirty. :)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9813#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list