
#13608: Expose the type of quasiquotes
-------------------------------------+-------------------------------------
Reporter: | Owner: (none)
facundo.dominguez |
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template | Version: 8.0.1
Haskell |
Keywords: QuasiQuotes | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets: 12778
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
It happens with inline-java that
{{{
[java| 0.0 |]
}}}
produces a static method in java
{{{
Object fresh_name() { return 0.0; }
}}}
where
{{{
double fresh_name() { return 0.0; }
}}}
would be preferred. This is better because the user would get an error if
the expression does not match the expected result type.
Examining the context in which the quasiquote is used would allow to build
the later variant. However, GHC provides no way to grab the type that it
expects of the quasiquote.
The quasiquote desugars as follows:
{{{
[java| 0.0 |]
====>
$(parseExp java " 0.0 ")
}}}
We have experimented with a patch that desugars instead like
{{{
[java| 0.0 |]
====>
let __ghc_qq_