splicing varPs in quasi-quote brackets

Geoffrey Mainland mainland at apeiron.net
Sat Mar 15 14:44:31 UTC 2014


Yes, pattern splices are indeed new in 7.8. See:

https://www.cs.drexel.edu/~mainland/2013/05/31/type-safe-runtime-code-generation-with-typed-template-haskell/

Cheers,
Geoff

On 03/15/2014 10:08 AM, Christian Höner zu Siederdissen wrote:
> Thanks Adam,
>
> It indeed does work with a lambda, should've thought about it. So, it
> seems splices in patterns are new in 7.8 (hadn't seen it in the notes).
>
> Gruss,
> Christian
>
> * adam vogt <vogt.adam at gmail.com> [15.03.2014 05:12]:
>> Hello Christian,
>>
>> It seems new to me that $( ) is allowed in patterns. I would have used
>> lamE in something like:
>>
>> [| $(varE v) >>= return . SM.concatMapM $(lamE [varP v] (buildRns f
>> (xs++[w]) ys))) |]
>>
>> Regards,
>> Adam


More information about the Glasgow-haskell-users mailing list