• snoyberg's avatar
    Provide an optimized replicateM_ implementation #11795 · c4a7520e
    snoyberg authored
    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
Monad.hs 8.01 KB