patch applied (/haskell/ghc): Add 6.8.1 download page
Simon Marlow
simonmarhaskell at gmail.com
Mon Nov 5 04:15:53 EST 2007
Simon Peyton-Jones wrote:
> | 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.
I think that -fno-print-bind-result should be the default. Several people
have asked for this, indeed I'm not sure why we didn't make it the default
when we added the option:
http://hackage.haskell.org/trac/ghc/ticket/887
Cheers,
Simon
More information about the Cvs-ghc
mailing list