
#9120: Cache intermediate powers -------------------------------------+------------------------------------ Reporter: basvandijk | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by meteficha): I have no idea what is the purpose of this code, but why not the following? {{{#!haskell expt 2 e | e <= maxExpt2 = expts2 ! e | otherwise = expts2 ! maxExpt2 * expt 2 (e-maxExpt2) expt 10 e | e <= maxExpt10 = expts10 ! e | otherwise = expts10 ! maxExpt10 * expt 10 (e-maxExpt10) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9120#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler