purescript/purescript-lists

replicateM -> replicateA ?

clayrat opened this issue · 4 comments

It seems that Monad isn't really necessary here, Applicative is enough:

replicateA :: forall f a. Applicative f => Int -> f a -> f (List a)
replicateA n f
  | n < one = pure nil
  | otherwise = cons <$> x <*> replicateA (n - one) f
paf31 commented

It's defined here.

close?

paf31 commented

Thanks

Hm, I thought about removing this function here, or at least putting a deprecation notice, but I guess I forgot.