streamly
streamly copied to clipboard
Consider changing the signature of replicateM unfold
replicateM :: Applicative m => Int -> Unfold m (m a) a
If the replication count depends on the input e.g. when we have to resample an array
and we have to iterate as many times as the array length then we need the count to
be passed via unfold i.e. it should be Unfold m (Int, m a) a. We can use
concatMap to pass the count argument to replicateM but that won't perform
well.