[GHC] #14474: reify RHS of "value" variable
GHC
ghc-devs at haskell.org
Thu Nov 16 15:30:34 UTC 2017
#14474: reify RHS of "value" variable
-------------------------------------+-------------------------------------
Reporter: dailectic | Owner: (none)
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: Template | Version: 8.2.1
Haskell |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
According to the [https://hackage.haskell.org/package/template-
haskell-2.12.0.0/docs/Language-Haskell-TH-Syntax.html#t:Info
documentation], when reifying value variables "returning the RHS has not
yet been implemented because of lack of interest". I'd like to formally
request interest since I don't see a ticket here (may have missed it).
My motivating example is to make source available for documentation and
better error messages. Something like:
{{{#!hs
printSource :: Name -> Q Exp
printSource n = do
VarI _ _ (Just dec) <- reify n
lift $ pprint dec
foo x = x * 2
fooSource = $(printSource 'foo) -- === "\x_0 -> x_0 GHC.Num.* 2"
}}}
How significant of a change is this? I could take a pass at it if pointed
to the relevant bits, having not contributed to GHC before.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14474>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list