[Haskell] specification of sum

John Meacham john at repetae.net
Wed Nov 2 19:02:36 EST 2005

On Wed, Nov 02, 2005 at 11:18:13AM -0000, Simon Marlow wrote:
> Also, we shouldn't be turning overloaded functions into class methods
> purely for the purposes of providing optimised versions; that's what the
> SPECIALISE pragma is for.

I am a little torn on the issue, on one hand, if it is purely for
performance, then yeah, that makes sense, and SPECIALISE is a pretty key
pragma for any compiler. (so much so that I have 5 variations on it in
jhc :) ). however, having a default of (+) a b = sum [a,b] might be
useful if sum and product are more straightforward to define for an
instance than + and *. however, I don't know if this ever actually
occurs in practice.


John Meacham - ⑆repetae.net⑆john⑈ 

More information about the Haskell mailing list