Because this works<br><br>Prelude&gt; read &quot;2.3&quot; + 1.0<br>3.3<br><br>Seriously I can only assume that via the inference it decides based on the one that the string must be of type Int and uses the Read instance of Int to parse it; whereas that string is obviously a float.<br>
<br>That is what<b> I think</b> it does.<br><br><div class="gmail_quote">On Thu, Apr 5, 2012 at 4:16 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">
Hello.<br>
<br>
Consider the following ghci session:<br>
<br>
   Prelude&gt; :t read &quot;2&quot; + 1<br>
   read &quot;2&quot; + 1 :: (Num a, Read a) =&gt; a<br>
<br>
   Prelude&gt; :t read &quot;2.3&quot; + 1<br>
   read &quot;2.3&quot; + 1 :: (Num a, Read a) =&gt; a<br>
<br>
   Prelude&gt; read &quot;2&quot; + 1<br>
   3<br>
<br>
   Prelude&gt; read &quot;2.3&quot; + 1<br>
   *** Exception: Prelude.read: no parse<br>
<br>
Why does (read &quot;2&quot; + 1) works, but (read &quot;2.3&quot; + 1) fail at runtime?<br>
<br>
Romildo<br>
<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>
</blockquote></div><br><br clear="all"><br>-- <br>Google+: <a href="https://plus.google.com/111881868112036203454" target="_blank">https://plus.google.com/111881868112036203454</a><br><br>