Hi Ian,

       *Main> 1+2
*** Exception: def.hs:1:0: No instance nor default method for class operation GHC.Num.+

This doesn't seem to be a big problem to me. If for some reason you do
need a Num () instance (which I imagine is pretty rare) and you don't
want numbers to be defaulted to () in ghci you can always set
-XNoExtendedDefaultRules in ~/.ghci. Hmm, actually, that appears not to
work; not sure what's going on there.

i would like not defaulting to () to be the default. there are already
sufficiently many things that can go wrong with defaulting and mmr,
no need to add another one. i am one of those who would like to
get rid of the mmr (certainly as a default behaviour) - having used
overloading, i do not recall a single instance where mmr was helpful,
but many where it wasn't. it bites particularly often in the context of ghci sessions, where code fragments are tested outside the context that might pin down their types, and mmr+defaults narrow types in the wrong directions, instead of leaving them overloaded at least. changing standard defaults in ghci will only make matters worse, in ways that are hard to predict/debug.

there are reasons why one might want different defaults in ghci
(i just don't think printf is a valid one), but a cleaner way to achieve that (without more flags) would be something like:

   :set default .. -- like default (..) in a module, but for a session
   :show default -- show current session defaults

Good point. We probably ought to make it an extension and give it a -X
flag anyway; I don't think (without having looked at the code) it should
be hard.

Bug filed here: http://hackage.haskell.org/trac/ghc/ticket/1824

i was only thinking of it as a documentation bug - see ticket.

claus

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to