[EMAIL PROTECTED] wrote:
> 
> This is a "Related Work" section of the previous message.
>
> ... again cunning stuff omitted ...
>

I buy most of this
but IMHO you should make very clear 
that there is not just a single safeCoerce, but the TI/init_typeseq
argument has to be constructed and supplied by the programmer
in a way that (s)he decides what array of types can be handled.
So if you wanted to use your approach to scrap boilerplate [1],
say deal with many datatypes, this becomes quite a burden.
Think of actually building initial type sequences. Think of
how combinators need to be parameterised to take type sequences.
(That's what I called a CWA yesterday.)

On the other hand, you mention this duality between type classes
vs. type heaps. Yes, I would say that type classes and type case
are somewhat dual. You provide a type case. What I like about your
type case vs. the approach taken in [1] is that your type case will
be very precise. That is, you don't say one can just try anything
what is Typeable but you rather restrict questions to the types 
in the supplied initial type sequence. This is certainly beneficial
for applications other than scraping boilerplate.

Ralf

[1}  "Scrap your boilerplate: a practical design pattern for generic
programming" 
     by Ralf Lämmel and Simon Peyton-Jones, 
     appeared in Proceedings of TLDI 2003, ACM Press 
     http://www.cs.vu.nl/boilerplate/#paper

-- 
Ralf Laemmel
VU & CWI, Amsterdam, The Netherlands
http://www.cs.vu.nl/~ralf/
http://www.cwi.nl/~ralf/
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to