<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small">Hi All,</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:georgia,serif">I'm writing a code, where the input is read from a text file using: </span></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">readValues = readFile "Input.txt"</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif">Since the type of this is '</font><font face="monospace, monospace">IO String'</font><font face="georgia, serif">, I can't use this in the consequent functions.</font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif">For an example: I want to split this as follows within another function</font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif"><br></font></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">extractInput url method template</font></div><div class="gmail_default"><font face="monospace, monospace"> | isURI url == True = getList values components</font></div><div class="gmail_default"><font face="monospace, monospace"> | otherwise = []</font></div><div class="gmail_default"><font face="monospace, monospace"> where components = splitTemplate readValues</font></div><div class="gmail_default"><font face="monospace, monospace"> values = getURL (splitURL url) method</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="georgia, serif">This gives the following error:</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace" color="#ff0000"><div class="gmail_default"> Couldn't match type ‘IO String’ with ‘[Char]’</div><div class="gmail_default"> Expected type: String</div><div class="gmail_default"> Actual type: IO String</div></font></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif">How can I solve this?</font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="georgia, serif">Thanks in advance! </font></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><font face="georgia,serif">Regards, <br>Dananji Liyanage</font></div></div></div></div></div>
</div>