On Fri, May 29, 2009 at 5:36 AM, Max Rabkin <[email protected]> wrote: > On Fri, May 29, 2009 at 12:29 PM, Paul Keir <[email protected]> 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-evaluation.html#extended-default-rules _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
