title: What is really being imported in Haskell
body: <p>Perhaps it's a bit silly question, but I'm used to scripting languges, where the question never occurs, as there's no compilation at all. The question is: what is really imported to a Haskell executable: are whole imported libs incorporated or does it rather include in the executable only the code that is really necessary to run the program?</p>
  
  <p>Suppose I have something like that:</p>
  
  <pre><code>import qualified Data.Set as Set
  
  mySet = Set.fromList [1..5]
  
  main = print $ Set.filter (\x -&gt; x `mod` 2 == 0) mySet
  </code></pre>
  
  <p>Is whole <code>Data.Set</code> module included to the executable? Or does it rather include only <code>Set</code> definition and <code>fromList</code> and <code>filter</code> functions? Does it make any difference if I write:</p>
  
  <pre><code>import qualified Data.Set as Set (Set, fromList, filter)
  </code></pre>
  
  <p>At least executable size does not seem affected with the change...</p>