title: Couldn't match type ‘IO String’ with ‘[Char]’
body: <p>I am having a project to do for school where I am required to read from file, being given the head of the function I have to implement.</p>
  
  <p>I have the following function already being give which I assume it reads the file that has the name "file_name":</p>
  
  <pre><code>getInputTest file_name = do  
      x &lt;- readFile file_name
      return x
  </code></pre>
  
  <p>Next, I have to parse each line of the text, in order to get a vector of Strings, each element of the vector being one line of the file. This is where I am give the head of the function I have to implement:</p>
  
  <pre><code>parse :: String -&gt; [Instr]
  </code></pre>
  
  <p>The first argument of this function should be everything that is read from the file(all lines) and the [Instr] should be formed of all the lines from the file, each element of the vector being one line.(the "Instr" should be chosen by me and I tried choosing it "String", but it does not work)</p>
  
  <p>I already tried this:</p>
  
  <pre><code>parse file_name = lines (getInputTest file_name)
  </code></pre>
  
  <p>But I keep getting errors such as: "Couldn't match type ‘IO String’ with ‘[Char]’".</p>
  
  <p>What am I doing wrong and how can I fix it? Considering that the head of "parse" function should not be modified.</p>