If I run:
> runQ [p| zs@(z:_) |]
AsP zs_46 (InfixP (VarP z_47) GHC.Types.: WildP)
I'd like to replace zs
and z
with names I generate myself. I can replace z
:
> let z = mkName "z"
> runQ [p| zs@($(varP z):_) |]
AsP zs_48 (InfixP (VarP z) GHC.Types.: WildP)
but I cannot figure out how to replace zs
. Is there a way to do it inside quotes or do I have to resort to asP
, etc ... ?