2009/2/24 Bulat Ziganshin <bulat.zigans...@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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to