[Haskell-cafe] Template Haskell and Unit

Richard Eisenberg eir at cis.upenn.edu
Thu Aug 29 18:25:58 CEST 2013


I've always considered Unit to just be a nullary tuple. This intuition has never steered me wrong, and it seems that Template Haskell is making the same assumption. If there's some reason that this conflation of ideas is wrong, I would be eager to know -- th-desugar makes this assumption in several places.

Thanks,
Richard

On Aug 29, 2013, at 11:08 AM, "Jose A. Lopes" <jabolopes at google.com> wrote:

>> 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.
> 
> I am not sure I agree that those two constructions should be
> identical.  The Unit type is just a normal type with a single
> inhabitant: the unit value.  How is this related to tuples ?
> 
> 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





More information about the Haskell-Cafe mailing list