[Haskell-cafe] Template Haskell and Unit
Richard Eisenberg
eir at cis.upenn.edu
Thu Aug 29 16:13:48 CEST 2013
I can't answer about "expected behavior", but I can say that those two constructions should be considered identical by the $(…) splice construct. For better or worse, Template Haskell often offers multiple ways of encoding the same source Haskell phrase, and any code that processes Template Haskell syntax should probably treat the two constructs equivalently.
In a week or so, I'm hoping to release the first version of a new th-desugar package, which attempts to remove these redundancies by converting TH syntax into a smaller syntax tree. I'll announce here when it's ready for public consumption.
I hope this helps,
Richard
On Aug 29, 2013, at 9:03 AM, Jose A. Lopes wrote:
> Hi,
>
> I am positive about the following situation, but I can't find any
> concrete answer on the Web. Can anyone confirm this ?
>
> In template-haskell-2.7.0, the following quote
>
> [t| () |]
>
> appears as a (ConT name), where "name" is the name for unit. However,
> in template-haskell-2.8.0, the same quote appears as (TupleT 0).
>
> Is this the expected behaviour ?
>
> Thanks,
> Jose
>
> --
> Jose Antonio Lopes
> Ganeti Engineering
> Google Germany GmbH
> Dienerstr. 12, 80331, München
>
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschäftsführer: Graham Law, Christine Elizabeth Flores
> Steuernummer: 48/725/00206
> Umsatzsteueridentifikationsnummer: DE813741370
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
More information about the Haskell-Cafe
mailing list