Re: Modules and their explicit export lists (are an annoyance)

Hi Christian, Is there a specific library you're having trouble with? One reason library authors can prefer explicit export lists is that they can hide implementation details, which can then make it easier to change in the future without breaking the users of the library. Antoine Cc'ing the haskell-cafe On Jun 19, 2010 1:39 PM, "Christian Höner zu Siederdissen" < choener@tbi.univie.ac.at> wrote: Hi everybody, I'd like some input on other peoples' thoughts on this. Recently, I played around with a library that uses an explicit export list. While there are reasons for having one: - efficiencey (inlining in the module) - encapsulation in practice, it seems to me that they are more annoying than useful. For once, it would think that ghc should produce efficient good across modules with -O / -O2 anyway. But the more important thing is, that it makes extending module functionality a pain (eg. if a constructor is not exported using (..)). So, should I really fork a library just to be able to add a function? Btw. there are libraries, where an explicit export list is used, that export the right amount of information. For example, in 'vector' enough is exported to allow you to extend unboxed vectors. _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Antoine Latter
One reason library authors can prefer explicit export lists is that they can hide implementation details, which can then make it easier to change in the future without breaking the users of the library.
Also, with respect to cross-module optimisation, I seem to recall that GHC doesn't do this (but JHC is trying to do so). Explicit export lists not only help hide implementation details, they're also useful in cases where two modules export functions with the same name and someone decides to do un-qualified imports (i.e. just "import Foo"). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (2)
-
Antoine Latter
-
Ivan Lazar Miljenovic