<div dir="ltr"><div><div></div>I get a Num ambiguous constraint error as well, but it is merely not giving you the rest of the errors.<br><br></div><div>Prelude> let a1 = pure (1::Int)<br>Prelude> let a2 = pure (1::Int)<br></div><div>Prelude> a1 == a2<br>   • Ambiguous type variable ‘f0’ arising from a use of ‘a1’<br>      prevents the constraint ‘(Applicative f0)’ from being solved.<br><br></div><div>Furthermore you can't compare an IO a with an IO a, so it will still cause an error.  But if you go:<br></div><div><br></div><div>Prelude>let a1 = 1<br>Prelude>let a2 = 1<br>Prelude>a1 == a2<br></div><div>True<br><br></div><div>Then it is totally fine with that.<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 10:38 AM, Imants Cekusins <span dir="ltr"><<a href="mailto:imantc@gmail.com" target="_blank">imantc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><span style="font-size:14px">> what is the "default" structure if you don't specify any</span><div><br></div></span><div>similar to:</div><div><br></div><div>display::Show a => a -> String</div><div>display = show</div><div><br></div><div>fa::(Applicative f, Num a) => f a</div><div>fa = pure 1</div><div><br></div><div>f and a are <i>bounded</i> by Applicative and Num, so to say. No default. Or, it is typed however type is a bit broader than *</div><span class=""><div><br></div><div><br>> ​<span style="font-size:14px"> </span><span style="font-size:14px">In this case it defaults f to IO and a to Int, </span></div><div><span style="font-size:14px"><br></span></div></span><div><span style="font-size:14px">does it though?</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px"><br></span></div><div><span class=""><div>Prelude> let a1 = pure 1</div><div>Prelude> let a2 = pure 1</div></span><div>Prelude> a1 == a2</div><div style="font-size:14px"><br></div></div><div style="font-size:14px"><div><interactive>:20:1: error:</div><div>    • Ambiguous type variable ‘a0’ arising from a use of ‘a1’</div><div>      prevents the constraint ‘(Num a0)’ from being solved.</div><div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>