Hi,<br>Thanks for the clarification.<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">This is clearly depravity.</blockquote><br>I am confused, in what sense this is depravity?<br>
<br>Damodar<br><br><div class="gmail_quote">On Sun, Nov 18, 2012 at 7:27 AM, Albert Y. C. Lai <span dir="ltr"><<a href="mailto:trebla@vex.net" target="_blank">trebla@vex.net</a>></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 12-11-17 02:19 AM, damodar kulkarni wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Let's see tthis:<br>
Prelude> :t 3 "a"<br>
3 "a" :: (Num ([Char] -> t)) => t<br>
<br>
No complaint from GHC; but now see this:<br>
<br>
Prelude> :t "a" 3<br>
<br>
<interactive>:1:0:<br>
Couldn't match expected type `t1 -> t'<br>
against inferred type `[Char]'<br>
In the expression: "a" 3<br>
<br>
Why does it not fail for (:t 3 "a") but does fail for (:t "a" 3)?<br>
</blockquote>
<br></div>
3 is polymorphic, "a" is monomorphic (exactly [Char]).<br>
<br>
To make "a" polymorphic, turn on OverloadedStrings:<br>
<br>
:set -XOverloadedStrings<br>
:type "a"<br>
<br>
"a" :: Data.String.IsString a => a<br>
<br>
:type "a" 3<br>
<br>
"a" 3 :: (Num a, Data.String.IsString (a -> t)) => t<br>
<br>
Success!<br>
<br>
This is clearly depravity.<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br><br clear="all"><br><br>