On 28-Sep-1999, Alex Ferguson <[EMAIL PROTECTED]> wrote:
>
> It would be interesting to investigate adding 'dynamic classes' to
> Haskell, but it introduces the issue of what type to give the resulting
> function: I think I'd want to clearly distinguish between a genuine
> (boundedly) polymorphic function, and one which covertly does a case
> analysis of the (sub-)classes of its argument.
Agreed. The current Hugs/ghc Dynamic library does that,
by prefixing the type of the latter kind of function with
constraints of the form `Typeable t =>'.
If some language extension were introduced for dynamic type
class casts, then the compiler should infer a type constraint
of that form (`Typeable t'), or something along those lines,
for any code using that extension.
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.