[Template-haskell] Release

Simon Peyton-Jones simonpj@microsoft.com
Tue, 8 Apr 2003 13:45:02 +0100


|  As I understand it the GHC team are heading towards a release
including
|  TH in the not too distant future. I think it would be good if the
|  biggest outstanding issues could be fixed before then (and indeed,
just
|  fixed ASAP).

Yes, that's a good idea.

|  The one that causes me the most hoop jumping is the type parameters
to
|  some of the TH datastructures. For example, I have some code like
this:

It's all to do with Tim's "two-level types" scheme, but I do agree with
you that it seems more trouble than its worth.

Tim: how vigorously do you want to defend this?  If not, can we let Ian
remove the parameterisation?

Simon

|  -----Original Message-----
|  From: template-haskell-admin@haskell.org [mailto:template-haskell-
|  admin@haskell.org] On Behalf Of Ian Lynagh
|  Sent: 08 April 2003 13:17
|  To: template-haskell@haskell.org
| =20
| =20
|  As I understand it the GHC team are heading towards a release
including
|  TH in the not too distant future. I think it would be good if the
|  biggest outstanding issues could be fixed before then (and indeed,
just
|  fixed ASAP).
| =20
|  The one that causes me the most hoop jumping is the type parameters
to
|  some of the TH datastructures. For example, I have some code like
this:
| =20
|  class ToDec a where
|      to_dec :: a -> Dec
| =20
|  instance ToDec Dec where
|      to_dec =3D id
| =20
|  class ToExp a where
|      to_exp :: a -> Exp
| =20
|  instance ToExp Exp where
|      to_exp =3D id
| =20
|  instance (ToExp e, ToDec d) =3D> Foo (Match p e d) where
|      foo (Mat p (Normal e) ds) =3D bar (Normal (Let (map to_dec ds)
(to_exp e)))
| =20
|  Which I'd much rather be able to write as
| =20
|  instance Foo Match where
|      foo (Mat p (Normal e) ds) =3D bar (Normal (Let (map to_dec ds)
(to_exp e)))
| =20
|  Previous discussions about this have all petered out before reaching
a
|  conclusion, but I haven't seen anyone actually stand up and defend
the
|  parameterised types, and it's hard to see how they could be useful
|  without everything being parameterised anyway. Can we get rid of
them?
|  Please? Or at least have an explanation of why not...
| =20
|  Hmmm, or maybe I should be asking for them to be extended to cover
all
|  the types to make it easier to have a type of reification that
annotates
|  the tree with type and strictness information. I'd still have the
|  problem above, but at least more things would be possible.
| =20
|  Anyway, I'm confused, but sitting in the middle is just driving me
mad!
| =20
| =20
|  Thanks
|  Ian
| =20
|  _______________________________________________
|  template-haskell mailing list
|  template-haskell@haskell.org
|  http://www.haskell.org/mailman/listinfo/template-haskell