[Haskell-cafe] Template Haskell Splicing
Michael Sloan
mgsloan at gmail.com
Sat Dec 15 09:00:05 CET 2012
I don't think that there is a particular reason for not supporting
quasi-quotes in where clauses.. It should be added!
The reason for /splices/ to not be supported in here statements is that
they are run during type checking. That way calls to "reify" can access
type information for things before your splice. It also allows checking
any AST quotes used inside your splice. Since type-checking comes after
renaming, splices can't be used in patterns (because it would affect the
lexical scope).
Quasi-quotes, on the other hand, are run in the renamer, and ought to be
able to be used in where clauses. Yet for some reason they can't - I get
"parse error (possibly incorrect indentation or mismatched brackets)" when
I try to put one under a where.
Good catch!
-Michael
On Fri, Dec 14, 2012 at 11:09 PM, satvik chauhan <mystic.satvik at gmail.com>wrote:
> Is there any way to splice declarations inside where? If not, then what
> is the reason for not supporting this?
>
> -Satvik
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121215/67332108/attachment.htm>
More information about the Haskell-Cafe
mailing list