Skip to content
  • Michael Snoyman's avatar
    Provide an optimized replicateM_ implementation #11795 · c4a7520e
    Michael Snoyman authored and Ben Gamari's avatar Ben Gamari committed
    In my testing, the worker/wrapper transformation applied here
    significantly decreases the number of allocations performed when using
    replicateM_. Additionally, this version of the function behaves
    correctly for negative numbers (namely, it will behave the same as
    replicateM_ 0, which is what previous versions of base have done).
    
    Reviewers: bgamari, simonpj, hvr, austin
    
    Reviewed By: bgamari, simonpj, austin
    
    Subscribers: nomeata, simonpj, mpickering, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2086
    
    GHC Trac Issues: #11795
    c4a7520e