title: How do people typically develop Haskell modules?
body: <p>Sorry for the somewhat general question. I am new to Haskell, and I am the type of person who learns by diving into a problem and figuring out the required pieces as I go along. So, I've started developing a Haskell module that aims to do simple linear regression. Here is my directory setup:</p>
  
  <pre><code>mymod/
  - mymod.cabal
  - src/
  -- MyMod/
  --- Linear.hs
  --- Linear/
  ---- Regression.hs
  --- Data.hs
  --- Data/
  ---- Examples.hs
  - tst/
  </code></pre>
  
  <p>My cabal file looks like this:</p>
  
  <pre><code>library
    exposed-modules:     MyLib.Linear, MyLib.Linear.Classifier, 
                         MyLib.Data, MyLib.Data.Examples
    build-depends:       base == 4.6.*
    hs-source-dirs:      src
  </code></pre>
  
  <p>Right now, I am writing the <code>Examples</code> module, which is essentially a CSV file parser. That looks like this:</p>
  
  <pre><code>module Exampels (load) where
  
  import Text.ParserCombinators.Parsec
  import Control.Applicative
  
  examples = line `endBy` eol
  line = cell `sepBy` (char ',')
  
  cell :: GenParser Char st Double
  cell = rd &lt;$&gt; many1 (noneOf ",\n")
      where rd = read :: String -&gt; Double
  
  eol = char '\n'
  
  load :: String -&gt; Either ParseError [[Double]]
  load input = parse examples "(unknown)" input
  </code></pre>
  
  <p>This was the first piece of the system that I wrote. I tested this by using <code>ghci</code> and <code>:l Examples.hs</code> from <code>mylib/src/MyLib/Data/</code> followed by <code>load "5\n"</code> and verified the result. Now I want to start writing the regression logic, but I want to test this code in conjunction with the CSV parser I already wrote. How to people typically go about testing code like this? </p>
  
  <p>For instance, in Java I would typically create a new package with a class that has a main method in it. With Java, this is straight forward to me because I understand how the classpath works and can direct the compiler to look for my classes that I want to run. How do I do this in Haskell? </p>
  
  <p>Thanks!</p>