[Template-haskell] TupleT type constructor

Simon Peyton-Jones simonpj at microsoft.com
Fri Nov 2 14:04:16 EDT 2007


| > 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


More information about the template-haskell mailing list