[Haskell-cafe] Implementation of "Dynamic" datatype

Isaac Dupree isaacdupree at charter.net
Sat Mar 3 08:23:08 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan O'Rear wrote:
> On Sat, Mar 03, 2007 at 09:18:00AM +0000, Lennart Augustsson wrote:
>> Why would there be an extra function?
> Because the compiler can't statically prove that the typeRep field of
> the dictionary doesn't depend on its argument.  Therefore, the
> function cannot be unpacked.  (Or can it?  Could hbc?)

Unfortunately it would be difficult for the compiler to know that no-one
is going to make an instance that does depend on its argument (as long
as it does not do full-program analysis to determine the layout of data
structures). Maybe there should be some sort of annotation on class
method arguments that are supposed to be ignored, even if only a pragma,
if it would help compilers figure this out.

Isaac

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF6Xa8HgcxvIWYTTURAlQsAKDEmR2J5nls66JQKV9DhN+p8lJPBwCgjvlD
aHyhsMn/OWoO2hUT390L0AQ=
=/RRh
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list