Sorry, I was actually trying to use this as an example for something more complicated I am trying to do.&nbsp; In this example, why would the inferred type be &quot;IO ()&quot;<br><br>aa :: String -&gt; String<br>aa instr = do<br>
&nbsp; putStrLn &quot;abc&quot;<br>&nbsp; putStrLn &quot;abc&quot;<br>&nbsp; return &quot;Az&quot;<br><br>&nbsp; Couldn&#39;t match expected type `[t]&#39; against inferred type `IO ()&#39;<br>&nbsp;&nbsp;&nbsp; In the expression: putStrLn &quot;abc&quot;<br>
&nbsp;&nbsp;&nbsp; In a &#39;do&#39; expression: putStrLn &quot;abc&quot;<br>&nbsp;&nbsp;&nbsp; In the expression:<br>&nbsp;&nbsp;&nbsp; do putStrLn &quot;abc&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; putStrLn &quot;abc&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; return &quot;Az&quot;<br><br><div><span class="gmail_quote">
On 9/24/07, <b class="gmail_sendername">Sam Hughes</b> &lt;<a href="mailto:hughes@rpi.edu">hughes@rpi.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
John Wicket wrote:<br>&gt; I am still in an imperative way of thinking.&nbsp;&nbsp;In this example here; how<br>&gt; would I call &quot;putStrLn&quot; and then set the function with a value.&nbsp;&nbsp;Eg:<br>&gt;<br>&gt; aa :: String -&gt; IO ()
<br>&gt; aa instr = do<br>&gt;&nbsp;&nbsp; putStrLn &quot;abc&quot;<br>&gt;&nbsp;&nbsp; putStrLn &quot;abc&quot;<br>&gt;&nbsp;&nbsp; return &quot;123&quot;<br>&gt;<br>&gt; --- The error I am getting.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Couldn&#39;t match expected type `()&#39; against inferred type `[Char]&#39;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In the first argument of `return&#39;, namely `&quot;123&quot;&#39;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In the expression: return &quot;123&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In the expression:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; do putStrLn &quot;abc&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;putStrLn &quot;abc&quot;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return &quot;123&quot;<br><br>Your type signature is wrong.&nbsp;&nbsp;If you want an IO action whose return<br>value is a String, say so:<br><br>aa :: String -&gt; IO String<br></blockquote></div><br>