
31 May
2009
31 May
'09
12:05 a.m.
On Fri, May 29, 2009 at 5:36 AM, Max Rabkin
On Fri, May 29, 2009 at 12:29 PM, Paul Keir
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.
http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluati...