[Haskell-cafe] [] == []
Max Rabkin
max.rabkin at gmail.com
Fri May 29 06:36:19 EDT 2009
On Fri, May 29, 2009 at 12:29 PM, Paul Keir <pkeir at dcs.gla.ac.uk> wrote:
> f''' = ([]::[()]) == ([]::[()])
>
> (Very pretty.)
>
> So why doesn't ghc have 'default' instances?
It does. I believe Num defaults to Integer and then to Double.
Generally, though, defaults are convenient in exploratory usage but
confusing in compiled code. In compiled code, you don't want arbitrary
choices of defaults to affect performance and correctness.
I've had programs run much slower than expected because the types
defaulted to Integer rather than Int.
--Max
More information about the Haskell-Cafe
mailing list