[Haskell-cafe] GHC predictability

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue May 13 19:15:00 EDT 2008


On 2008 May 13, at 17:01, Andrew Coppin wrote:

> That definition of mean is wrong because it traverses the list  
> twice. (Curiosity: would traversing it twice in parallel work any  
> better?) As for the folds - I always *always* mix up

It might work "better" but you're still wasting a core that could be  
put to better use doing something more sensible.  It's pretty much  
always best to do all the calculations that require traversing a given  
list in a single traversal.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list