<div dir="ltr"><div>So normally it should fail but the default typing in ghci is the one who makes our life easier.<br><br></div>Thanks for the explanation!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 5:33 PM, David McBride <span dir="ltr"><<a href="mailto:toad3k@gmail.com" target="_blank">toad3k@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"><div>Rather than bailing with an instance error for both Applicative and Num, which is the technically the right way, and the way that it used to be in the dark ages of ghci. Instead it chooses types which are probably what you wanted. In this case it defaults f to IO and a to Int, and then runs it.<br><br></div>You can read more about type defaulting in ghci here: <a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html" target="_blank">https://downloads.haskell.org/<wbr>~ghc/latest/docs/html/users_<wbr>guide/ghci.html</a><tt class="m_1653020684323581409gmail-xref m_1653020684323581409gmail-std m_1653020684323581409gmail-std-ghc-flag m_1653020684323581409gmail-docutils m_1653020684323581409gmail-literal"><span class="m_1653020684323581409gmail-pre"></span></tt></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 10:18 AM, Ovidiu Deac <span dir="ltr"><<a href="mailto:ovidiudeac@gmail.com" target="_blank">ovidiudeac@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">My understanding is that x can take any form required for type-inference. That's fine but what is the "default" structure if you don't specify any?<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_1653020684323581409h5">On Thu, Dec 22, 2016 at 5:13 PM, Imants Cekusins <span dir="ltr"><<a href="mailto:imantc@gmail.com" target="_blank">imantc@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_1653020684323581409h5"><div dir="ltr">> <span style="font-size:14px">What is f here?</span><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">anything Applicative:</span></div><div><span style="font-size:14px"><br></span></div><div><div>Prelude> let a1 = pure 1</div><div>Prelude> let a2 = pure 1</div><div style="font-size:14px"><br></div></div><div style="font-size:14px"><div>Prelude> (a1::Maybe Int) == a2</div><div>True</div><div>Prelude> (a1::Maybe Float) == a2<br></div><div>True</div><div>Prelude> (a1::Either String Float) == a2</div><div>True</div><div><br></div></div><div style="font-size:14px"><br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/beginners</a><br>
<br></blockquote></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>