| 1 the () defaulting in ghci looks highly dubious to me;
|     having an 'instance Num ()', as given in the doc example,
|     means that all arithmetic will fail, suggesting that this hack
|     is far too intrusive:
|
|         *Main> 1+2
|         *** Exception: def.hs:1:0: No instance nor default
|                 method for class operation GHC.Num.+
|
|     instead of meddling with a wide-ranging and subtle
|     feature like defaults, wouldn't it be easier to switch
|     off ghci's printing of io-results? or use the old standby
|
|         void m = m >> return ()

Well perhaps. But I think all the other alternatives (that I know of) have 
their own disadvantages.  E.g. I'm sure we'd get complaints if we did something 
wide ranging like switching off the printing of IO-results.

The current system has the advantage that it's almost always just what you 
want, but the disadvantage that it will behave oddly in very obscure 
circumstances (when you define instance Num ()).  So we just documented the 
obscure behaviour.  Let's see if it bites anyone.

|     in any case, it would be nice to have a ':show defaults'
|     or something, so that one can see what is going on, and
|     wrong.

I agree with that.

Simon

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

Reply via email to