on master help sign in
Add a TODO about replicateM unfold
b4450a4Harendra Kumar
core/src/Streamly/Internal/Data/Unfold.hs+6
@@ -687,6 +687,12 @@ fromListM = Unfold step pure
687-- Specialized Generation
687-- Specialized Generation
688------------------------------------------------------------------------------
688------------------------------------------------------------------------------
689
689
690+-- XXX If the count depends on the input e.g. when we have to resample (see
691+-- resample in streamly-statistics) an array and we have to iterate as many
692+-- times as the array then we need the count to be passed via unfold i.e. it
693+-- should be Unfold m (Int, m a) a. We can use concatMap to pass the count
694+-- argument to replicateM but that won't perform well.
695+--
690-- | Generates a stream replicating the seed @n@ times.
696-- | Generates a stream replicating the seed @n@ times.
691--
697--
692-- /Since: 0.8.0/
698-- /Since: 0.8.0/