title: How to import a .hs file in Haskell
body: <p>I have made a file called <code>time.hs</code>. It contains a single function that measures the execution time another function.</p>
  
  <p>Is there a way to import the <code>time.hs</code> file into another Haskell script?</p>
  
  <p><strong>I want something like:</strong></p>
  
  <pre><code>module Main where
  import C:\Haskell\time.hs
  
  main = do
      putStrLn "Starting..."
      time $ print answer
      putStrLn "Done."
  </code></pre>
  
  <p><strong>Where time is defined in the 'time.hs' as:</strong></p>
  
  <pre><code>module time where
  Import &lt;necessary modules&gt;
  
  time a = do
  start &lt;- getCPUTime
  v &lt;- a
  end   &lt;- getCPUTime
  let diff = (fromIntegral (end - start)) / (10^12)
  printf "Computation time: %0.3f sec\n" (diff :: Double)
  return v
  </code></pre>
  
  <p>I don't know how to import or load a separate <code>.hs</code> file. Do I need to compile the <code>time.hs</code> file into a module before importing?</p>