Investgate rules to optimize `pack . replicateM`
winterland1989 opened this issue · comments
winterland commented
It's common to pack a vector from a list generated by replicateM
:
V.pack . replicateM n $ do
...
V.packN n . replicateM n $ do
There should be rules to eliminate the list, probably already covered by foldM
rules in the base, have to read the core to find out. If rules doesn't play out, should add vector version's replicateM :: Vec v a => Int -> m a -> m (v a)
winterland commented
Add replicateMVec
in 0.8.8
, closed.