<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 10, 2015 at 8:21 AM, Lyndon Maydwell <span dir="ltr"><<a href="mailto:maydwell@gmail.com" target="_blank">maydwell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>GHC 7.8.3 here.</div><div><br></div>Hmm, on second inspection I believe that the Bool reference is to the top-level expression, not the list items after all.<div><br></div><div>I don't seem to get any defaulting behaviour either when not using GHCi. This seems to indicate that the extended interactive type defaulting is coming into play:</div><div><br></div><div><a href="https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_guide/interactive-evaluation.html" target="_blank">https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_guide/interactive-evaluation.html</a><br></div><div><br></div><div>I'd guess that this means that the () default is being used. -Wall seems to indicate that this is in-fact the case:</div><div><br></div><div><br></div><div><div>[Prelude] λ [] == []</div><div><br></div><div><interactive>:2:4: Warning:</div><div>    Defaulting the following constraint(s) to type ‘()’</div><div>      (Eq t0) arising from a use of ‘==’</div><div>    In the expression: [] == []</div><div>    In an equation for ‘it’: it = [] == []</div><div>True</div></div><div><br></div><div><br></div><div>Hope this helps.</div><span></span><br></div></blockquote><div><br>Thats better -- thanks Lyndon! <br></div><div><br></div><div>So after some fishing around I find the more pointed warning I am after is<br>-fwarn-type-defaults<br><br></div><div>The docs seem confusing though:<br><br><a href="https://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/options-sanity.html">https://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/options-sanity.html</a><br><br>Under -fwarn-type-defaults:<br>says<br><br><div style="margin-left:40px"><i>Have the compiler warn/inform you where in your source the Haskell defaulting mechanism for numeric types kicks in.</i><br></div><br>Wheres the numeric here?<br><br></div></div>
</div></div>