`Covertible' class. Reply.

Hannah Schroeter uk1o@rz.uni-karlsruhe.de
Sat, 10 Feb 2001 17:00:30 +0100


On Fri, Feb 09, 2001 at 02:59:53AM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> [...]

> Defining a domain by a sample argument is neither elegant (most of
> the time it's not needed because the type determines the domain)
> nor general (when considering domains not defined by types, there
> can be more than one domain sharing a value of the carrier type).
> So this is generally a bad idea.

Agree. And if an explicit type is needed, you can still use
type declarations. And if you need the type from a sample value,
you can use `asTypeOf` (where asTypeOf :: a -> a -> a;
foo `asTypeOf` bar = foo).

Kind regards,