[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Some random newbie questions
From:       Jorge Adriano Aires <jadrian () mat ! uc ! pt>
Date:       2005-01-09 22:57:23
Message-ID: 200501092257.23791.jadrian () mat ! uc ! pt
[Download RAW message or body]

> (+) is
> usually strict on both arguments (although in principle it does not
> have to be true because of overloading, which implies that a compiler
> can only optimize particular specializations of sum, not generic sum).

Since you mention it, there was some talk about this in the #haskell channel, 
and I wondered why aren't sum and product members of Num with default 
instances, just like mconcat is also a member of Data.Monoid.Monoid. 
From the docs: 

"mconcat :: [a] -> a
Fold a list using the monoid. For most types, the default definition for 
mconcat will be used, but the function is included in the class definition so 
that an optimized version can be provided for specific types"

J.A.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic