<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 20 Sep 2006, at 22:21, Ashley Yakeley wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Arie Peterson wrote:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">You absolutely right about this defaulting breaking referential transparency.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Do you know if it can be switched off in GHC? I know one can switch on warnings when it happens, but I don't think that's the same thing.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>You can use an empty default declaration to switch off default types for a particular module, but I don't think you can do this for all modules, or at least not in standard Haskell - section 4.3.4 of the language manual says:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Times" size="4"><SPAN class="Apple-style-span" style="font-size: 16px;">"Only one default declaration is permitted per module, and its effect is limited to that module. If no default declaration is given in a module then it assumed to be: </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><BR></SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><BR></SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">   default (Integer, Double)</SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><BR></SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><BR></SPAN></FONT><FONT class="Apple-style-span" face="Times" size="4"><SPAN class="Apple-style-span" style="font-size: 16px;">The empty default declaration, </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">default ()</SPAN></FONT><FONT class="Apple-style-span" face="Times" size="4"><SPAN class="Apple-style-span" style="font-size: 16px;">, turns off all defaults in a module."</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Switching off default types may introduce error messages about top-level declarations with unbound type variables - for example</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    Ambiguous type variable `t' in the constraint:</DIV><DIV>      `Num t' arising from the literal `2' at /tmp/test.hs:3:4</DIV><DIV>    Possible cause: the monomorphism restriction applied to the following:</DIV><DIV>      k :: t (bound at /tmp/test.hs:3:0)</DIV><DIV>    Probable fix: give these definition(s) an explicit type signature</DIV><DIV>                  or use -fno-monomorphism-restriction</DIV><DIV><BR><BLOCKQUOTE type="cite"></BLOCKQUOTE></DIV>Turning off the monomorphism restriction makes the errors go away, but adding an explicit polymorphic type signature is probably better.<BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Robert</DIV></BODY></HTML>