[Haskell-cafe] Testing and module export lists

Ivan Miljenovic ivan.miljenovic at gmail.com
Wed Feb 24 18:10:50 EST 2010


On 24 February 2010 20:17, Magnus Therning <magnus at therning.org> wrote:
> I often find that I do want an export list to reduce clutter in the
> finished code, but for testing I'd like to expose everything in a
> module.  Is there a nice way to deal with this (using the C
> pre-processor would not qualify as "nice" ;-)?
> Maybe there's a switch that causes GHC to simply ignore the export
> list of a module and export everything?

If you start a function name with an underscore, it is "implicitly
exported" by GHC (I can't find the actual documentation page at the
moment however).  Whilst it may not appear in the export list, you are
still able to call it from outside the module.

This will, however, result in "ugly" function names as well as
possibly still have those items appear in the haddock documentation...

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
Joan Crawford  - "I, Joan Crawford, I believe in the dollar.
Everything I earn, I spend." -
http://www.brainyquote.com/quotes/authors/j/joan_crawford.html


More information about the Haskell-Cafe mailing list