<div dir="ltr">The problem is ExtendedDefaultRules only works when the whole type is unknown. If we know part of the type e.g. that it is [a] for some a as we figure out from length, or that it is (f a), then it doesn&#39;t kick in.<div>
<br></div><div>print works because &quot;hello&quot; :: (IsString a, Show a) =&gt; a</div><div><br></div><div>knows nothing about the argument a</div><div><br></div><div>and Show is included in the EDR list of blessed classes.</div>
<div><br></div><div>If at the repl you turn on OverloadedStrings and EDR</div><div><br></div><div>showList &quot;hello&quot; &quot;&quot;<br></div><div><br></div><div>will still blow up, because it can know you have an argument [a] with a Show a constraint on it, and IsString [a], so it fails to meet the fairly simplistic conditions required by EDR.</div>
<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 4:34 PM, Dag Odenhall <span dir="ltr">&lt;<a href="mailto:dag.odenhall@gmail.com" target="_blank">dag.odenhall@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 dir="ltr"><div><p style="margin:1.2em 0px!important"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">ExtendedDefaultRules</code> already provides this to some extent, for example it makes <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">print &quot;hello&quot;</code> work without type information.</p>



</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 10:09 PM, Dan Burton <span dir="ltr">&lt;<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@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 dir="ltr">Just to throw another curveball at this conversation, what about a general, ad-hoc solution for &#39;typeclass defaults&#39;? The logic goes like this: Is there an &quot;ambiguous type variable&quot; error due to the use of the IsString typeclass? Try defaulting to the String instance. If that doesn&#39;t work, try defaulting to Text. Repeat for a finite, explicit list of instances. If none of these defaults are successful, type error.<div>




<br></div><div>We have hard-coded this sort of behavior into the Num class. Why not just provide this general capability for arbitrary classes? Or at least hard-code it into IsString as well.</div><div><br></div><div>In the absence of this sort of solution, +1 to Edward&#39;s original proposal.</div>




<div><br></div><div>The &quot;o&quot; proposal is not viable because the oft-needed parens make it confusing and irritating to the new Haskeller.</div></div><div class="gmail_extra"><span><font color="#888888"><br clear="all">


<div>-- Dan Burton</div>


<br><br></font></span><div class="gmail_quote"><div><div>On Mon, Aug 26, 2013 at 12:41 PM, Henning Thielemann <span dir="ltr">&lt;<a href="mailto:lemming@henning-thielemann.de" target="_blank">lemming@henning-thielemann.de</a>&gt;</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><div><br>
On Mon, 26 Aug 2013, Gabriel Gonzalez wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;m guessing this is sarcastic, but I just want to clarify what I understood Henning&#39;s proposal to be.  He&#39;s not saying we should provide an `o` function in the standard library, but rather encourage users to define their own.<br>





</blockquote>
<br></div>
Yes. I would be ok if packages provide this function, but I would urge programmers to import that explicitly.<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 This one liner would take the place of the current line that they devote right now to `OverloadedStrings` .<br>
</blockquote>
<br></div>
right<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
However, the analogy is still apt since the exact same line of reasoning applies to overloaded numeric<br>
literals where we currently rely on defaulting to solve this problem.<br>
</blockquote>
<br></div>
I always use -Wall and thus I am warned about when defaulting takes place. Thus I am confident that I do not rely on defaulting in my code.<br>
<br></div></div><div>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>