Quasi quoting
Isaac Dupree
ml at isaac.cedarswampstudios.org
Tue Feb 2 11:18:42 EST 2010
Max Bolingbroke wrote:
> ...
> In this proposal, you can then export "t" and "d" functions from
> Language.Haskell.TH with the type:
>
> t :: String -> Type
> d :: String -> [Decl]
>
> Which parse the provided string as Haskell. This allows existing any
> uses of Template Haskell to remain *unchanged* (as long as they
> imported the TH module :-). Otherwise rewrite them as:
>
> [t|..|] ==> Language.Haskell.TH.t [|...|]
I'm concerned in both your proposals, that single-letter names like "t"
and "d" are common function parameters, thus possibly producing
- shadowing warnings for all such functions in modules that happen to use TH
- errors, I think, for some uses of TH inside such functions (either the
function parameters must be renamed, or the TH splice module-qualified)
-Isaac
More information about the Glasgow-haskell-users
mailing list