title: Function privacy and unit testing Haskell
body: <p>How do you deal with function visibility and unit testing in Haskell?</p>
  
  <p>If you export every function in a module so that the unit tests have access to them, you risk other people calling functions that should not be in the public API.</p>
  
  <p>I thought of using <code>{-# LANGUAGE CPP #-}</code> and then surrounding the exports with an <code>#ifdef</code>:</p>
  
  <pre><code>{-# LANGUAGE CPP #-}
  
  module SomeModule
  #ifndef TESTING
  ( export1
  , export2
  )
  #endif
  where
  </code></pre>
  
  <p>Is there a better way?</p>