title: Read list of numbers in haskell
body: <p>I'm learning Haskell and I was working in a problem where I had to remove repeated consecutive numbers from a list, so I wrote this program.</p>
  
  <pre><code>destutter::[Integer] -&gt; [Integer]
  destutter [] = []
  destutter (fst:snd:t) | fst == snd = destutter (snd : t)
  destutter (h:t) = [h] ++ (destutter t)
  </code></pre>
  
  <p>It works fine for the input test that I had which was a list</p>
  
  <pre><code>input = [200, 271, 305, 305, 180]
  </code></pre>
  
  <p>now I have a text file with a lot of inputs and I need to use my function on it, if it was in C++ I would do something like:</p>
  
  <pre><code>while(cin&gt;&gt; x)
      v.push_back(x);
  destutter(x);
  </code></pre>
  
  <p>But I'm completely new to Haskell and I have no idea how I would do that on this language. I found <a href="https://stackoverflow.com/questions/9754794/read-until-end-of-stream-in-haskell">this</a> answer on stack overflow but was not able to modify the code for my use, so if someone could give a noob a hand I would be very thankful. My text file has the following structure:</p>
  
  <pre><code>260
  221
  235
  268
  ...
  </code></pre>