[GHC] #11795: Performance issues with replicateM_
GHC
ghc-devs at haskell.org
Wed Apr 6 12:39:00 UTC 2016
#11795: Performance issues with replicateM_
-------------------------------------+-------------------------------------
Reporter: snoyberg | Owner: snoyberg
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 7.10.3
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: Runtime | (amd64)
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by snoyberg):
Actually, it would appear that Ben already modified the implementation of
`replicateM_` to something different than I saw:
{{{#!hs
replicateM_ 0 _ = pure ()
replicateM_ n x = x *> replicateM_ (pred n) x
}}}
The implementation I've given here still seems to perform better, due to
usage of the worker/wrapper transform. It also keeps the semantics of the
current version in GHC 7.10.3 for negative values.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11795#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list