[Haskell-cafe] Re: variadic functions and typeCast

Michael Shulman viritrilbia at gmail.com
Thu Sep 28 00:45:34 EDT 2006

On 9/27/06, oleg at pobox.com <oleg at pobox.com> wrote:
> First of all, there is a version of TypeCast that works within the
> same module, please see any code described in
>         http://pobox.com/~oleg/ftp/Haskell/typecast.html

Yes, I was aware of that; I gave the shorter version just because it's
shorter.  I didn't realize how well-known this TypeCast is, so forgive
my ignorance.

Thanks for your answer.  I think the real point at which I was
confused is that the type-checker never unifies types in order to
*find* an instance of a class, but functional dependencies of a class
can make it unify types.  Thus, by making the instance look more
general but moving the unification into a TypeCast constraint, since
TypeCast has a bidirectional fundep, we can make the instance match a
pair of types that aren't yet unified, and then use TypeCast's fundep
to force their unification.  Is that right?


More information about the Haskell-Cafe mailing list