title: How to read data from IO into data-structure and then process the data-structure?
body: <p>first off sorry for doing the typical thing of 'where do I begin', but I'm totally lost.</p>
  
  <p>I've been reading the 'Learn you a haskell for great good' site for what feels like an age now (pretty much half a semester.  I'm just about to finish the 'Input and Output' chapter, and I still have no clue how to write a multi line program.</p>
  
  <p>I've seen the do statement, and that you can only use it to concat IO actions into a single function, but I can't see how I'm gonna go about writing a realistic application.</p>
  
  <p>Can someone point me in the right direction.</p>
  
  <p>I'm from a C background, and basically I'm using haskell for one of my modules this semester at uni, I want to compare C++ against haskell (in many aspects).  I'm looking to create a series of searching and sorting programs so that I can comment on how easy they are in the respective languages versus their speed.</p>
  
  <p>However, I'm really starting to loose my faith in using Haskell as its been six weeks, and I still have no idea how to write a complete application, and the chapters in the site I'm reading seem to be getting longer and longer.</p>
  
  <p>I basically need to create a basic object which will be stored in the structure (which I know how to do), more what I'm struggling with is, how do I create a program which reads data in from some text file, and populates the structure with that data in the first place, then goes on to process it.  As haskell seems to split IO and other operations and it won't just let me write multiple lines in a program, I'm looking for something like this:</p>
  
  <pre><code>main = data &lt;- getContent
         let allLines = lines data
         let myStructure = generateStruct allLines
         sort/search/etc
         print myStructure
  </code></pre>
  
  <p>how do I go about this?  any good tutorials which will help me get going with realistic programs?</p>
  
  <p>-A</p>