title: Haskell Regex - Couldn't match type ‘[Char]’ with ‘IO () error
body: <p>Within Haskell I have a program that <strong>scrapes</strong> the html off a page and stores it in a variable called 'html' which is type IO (). I then want to generate a list of type String that holds all the matches by a pattern from that web page.</p>
  <p>These two lines below generate a list of matches from the pattern</p>
  <pre><code>let pattern = &quot;...&quot; --note, regex is omited
  html =~ pattern :: String -&gt; IO String
  </code></pre>
  <p>I get the error:</p>
  <p><a href="https://i.stack.imgur.com/YciNC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YciNC.png" alt="enter image description here" /></a></p>
  <p>What I want to do is something like:</p>
  <pre><code> let pattern = &quot;...&quot; 
   let matches_list = html =~ pattern :: String -&gt; IO String 
  </code></pre>
  <p>Where matches_list of type String is a list of matches.</p>
  <p><strong>EDIT</strong></p>
  <hr />
  <p>The actual <strong>scraper</strong> which I got from <a href="https://hackage.haskell.org/package/tagsoup" rel="nofollow noreferrer">here</a> works simply like this:</p>
  <p><a href="https://i.stack.imgur.com/7quBX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7quBX.png" alt="enter image description here" /></a></p>
  <p>Imagine 'src' is my 'html' variable</p>