See this:<br><span style="font-family:courier new,monospace">Prelude&gt; :t 2.3</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">2.3 :: Fractional a =&gt; a</span><br style="font-family:courier new,monospace">

<br>Hope this helps.<br><br><br><div class="gmail_quote">On Thu, Apr 5, 2012 at 7:24 PM,  <span dir="ltr">&lt;<a href="mailto:j.romildo@gmail.com">j.romildo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Thu, Apr 05, 2012 at 01:18:39PM +0000, Amy de Buitléir wrote:<br>
&gt;  &lt;j.romildo &lt;at&gt; <a href="http://gmail.com" target="_blank">gmail.com</a>&gt; writes:<br>
&gt; &gt; Why does (read &quot;2&quot; + 1) works, but (read &quot;2.3&quot; + 1) fail at runtime?<br>
&gt;<br>
&gt; Try this:<br>
&gt;<br>
&gt; read &quot;2.3&quot; + 1 :: Float<br>
&gt;<br>
&gt; Or this:<br>
&gt;<br>
&gt; read &quot;2.3&quot; + 1.0<br>
&gt;<br>
&gt; The reason that your version didn&#39;t work is because GHCi is guessing that you<br>
&gt; want the read operation to parse an Integer, since you&#39;re adding it to 1.<br>
<br>
</div>This is explanation does not seem to be enough once we consider the type<br>
of the literal 1:<br>
<br>
   Prelude&gt; :t 1<br>
   1 :: Num a =&gt; a<br>
<br>
That is, the literal 1 is overloaded to any numeric type. It is not<br>
necessarily an Integer.<br>
<br>
Romildo<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thanks and regards,<br>-Damodar Kulkarni<br><br>