Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

Svein Ove Aas svein.ove at aas.no
Tue Feb 24 07:47:44 EST 2009

2009/2/24 Bulat Ziganshin <bulat.ziganshin at gmail.com>:
> Hello Felipe,
> Tuesday, February 24, 2009, 11:24:19 AM, you wrote:
>> Too bad 'Map' is exported as an abstract data type and it's not
>> straighforward to test this conjecture. Any ideas?
> just make a copy of its implementation to test
> btw, i always thought that it should be a way to overcome any export
> lists and go directly to module internals. limiting export is the way
> to protect programmer from errors, not security feature, and it should
> be left to programmer to decide when he don't need it. compilers
> should just be able to check whether some module/library imported
> abstractly or with internals too. this will render useless all those
> .Internals modules that now we need to add everywhere
I agree in principle, but GHC also uses that knowledge to optimize the
code better - if a function is exported it has to produce the most
polymorphic possible code for its type, if it isn't it can specialize
better... that sort of thing.

So it's not for security purposes, it's for technical reasons; you
can't override the export list externally because the information
you'd need to use the functions simply doesn't exist.

More information about the Haskell-Cafe mailing list