deriving instances for "hidden" types

Scott J. jscott@planetinternet.be
Tue, 30 Jul 2002 02:00:33 +0200


Is Template Haskell a new form of Haskell? And where can I find
documentation about it?

SCott


----- Original Message -----
From: "Simon Peyton-Jones" <simonpj@microsoft.com>
To: "Hal Daume III" <hdaume@ISI.EDU>; "Haskell Mailing List"
<haskell@haskell.org>
Sent: Monday, July 29, 2002 11:26 AM
Subject: RE: deriving instances for "hidden" types


> | I've often felt a tinge of disappointment not being able to
> | derive classes over data structures that are defined in the
> | libraries (DeepSeq FiniteMap, for instance).  I was wondering
> | if any of the tools (drift, etc.) or GHCs built-in meta
> | programming would allow you to say something like:
> |
> | derive (DeepSeq a, DeepSeq b) => DeepSeq (FiniteMap a b)
>
> I think Hal was only suggesting doing this in case where
> the representation of the data structure was visible to the library
> client.  (As others have said, it's not a good idea if the rep is
> abstract.)
>
> Template Haskell will be able to do this.  Heart transplant operation
> is in progress.  Blood on floor, but patient still alive.
>
> Simon
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>