Bugs item #753152, was opened at 2003-06-12 02:29
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=753152&group_id=8032

Category: Compiler
Group: 5.04.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: strange non-optimising

Initial Comment:
Don't know if this is a bug, but it was at least
_surprising_ to find that

playerMostOccur [a] = a
playerMostOccur (x:xs)| numOccur x (x:xs)
                                  > 
                                  numOccur
(playerMostOccur xs) xs
                                  = x
                                | otherwise =
playerMostOccur xs

was exponentially slower when compiled with ghc-5.04.2
-O than:

playerMostOccur [a] = a
playerMostOccur (x:xs)| numOccur x (x:xs)
                                  > 
                                  numOccur pmo xs
                                  = x
                                | otherwise = pmo
                                  where pmo =
playerMostOccur xs

Although the student responsible for the code couldn't
spot the
obvious optimisation, I was expecting that GHC's
optimiser would. :)
If it's not a bug, could you explain it to me?

-Greg(gregm.at.cs.uwa.edu.au)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=753152&group_id=8032
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to