[GHC] #12410: Somehow detect splicing in ghci
GHC
ghc-devs at haskell.org
Mon Jul 2 12:51:00 UTC 2018
#12410: Somehow detect splicing in ghci
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
The GHCi prompt is only flexible because it has syntactic cues that it
uses to distinguish between expressions, declarations, imports, etc. With
Template Haskell splices, you have no such syntactic cues. The only way I
could envision comment:3 ever being feasible is if we hacked the
typechecker to treat `Q Exp` and `Q [Dec]`-returning splices differently,
which is a lot of work for questionable benefit.
comment:6 has the advantage that it's simple, works today, and is
consistent with how other expressions and declarations are treated in GHCi
(for instance, `3;` won't parse in GHCi's prompt). In light of this, I'm
inclined to favor the simpler solution.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12410#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list