[Template-haskell] TupleT type constructor

Ian Lynagh igloo at earth.li
Mon Oct 29 16:44:00 EDT 2007


Hi Fons,

On Mon, Oct 29, 2007 at 12:31:07PM +0100, Alfonso Acosta wrote:
> 
> I'm a bit confused about TupleT . Is is supposed to be only used when
> synthesizing types? (i.e. reify will never output such a type)?

Quasiquotes produce it:

Prelude Language.Haskell.TH> $( do t <- [t| (Int, Bool) |]; runIO $ print t; [| 1 |] )
AppT (AppT (TupleT 2) (ConT GHC.Base.Int)) (ConT GHC.Base.Bool)

> Should this be considered a bug or a feature? IMHO it's quite ugly to
> have two valid representations for the same type in the same AST
> structure.

I wouldn't be opposed to removing it (in fact, I think there is a
general feeling that lots of redundancies in the TH syntax should be
removed, e.g. the subthread starting with
http://www.haskell.org/pipermail/template-haskell/2006-August/000572.html
but no-one has yet taken the lead and proposed something).


Thanks
Ian



More information about the template-haskell mailing list