More default defaults

In normal Haskell you can use what is possibly the most obscure Haskell98 feature, the default keyword, to modify how type defaulting works, and resolve ambiguities — but only for numeric classes. The result is less type signatures, as below:

default(Double)main=print$2+1

In ghci, this defaulting has been extended to the Eq, Ord and Show classes, so we can write, in ghci:

>reverse[][]

and ghci will find the right Show instance. Now, in lambdabot, we can evaluate user’s code in the irc channel, but often the user has to add extra types to have the right Show instance found: