how and where to {-# specialize #-} ?

Simon Peyton-Jones simonpj@microsoft.com
Wed, 25 Jun 2003 09:35:42 +0100


| > The only workaround is to define T early,
| > import it into A, and specialise A.f there.
|=20
| What if A is a pre-defined module, say FiniteMap?
| Then I can't change its source text. (Which isn't even there.)
| (Of course, I can grab it from the source distribution.)
|=20
| It is sad that the usage of libraries containing polymorphic code
| (which is a good thing, for obvious software engineering reasons)
| seems to imply runtime overheads, by preventing specialisation.
|=20

I agree that it is sad.  The only way around it is to ship libraries
with *all* their source code (perhaps hidden in the interface file).
That could be done, but it'd be Real Work

s