RE: TupleT type constructor

Simon Peyton-Jones <[email protected]> Fri, 2 Nov 2007 18:04:16 +0000
Newsgroups gmane.comp.lang.haskell.template
Message-ID <BBB84A691C2E064EAAFB9876BF452D16B2EDC0CD@EA-EXMSG-C324.europe.corp.microsoft.com>
| > 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).

I agree.  As in: I would not be opposed to removing it.  But we'd just need to be sure there was a convenient way of conjuring up the appropriate data constructor for an n-tuple.

Simon