Proposal: genericReplicateM

Ken T Takusagawa kenta at mit.edu
Thu Jul 23 23:49:47 UTC 2015


Overloaded versions of replicateM and replicateM_ for any 
Integral type:

genericReplicateM :: (Monad m, Integral i) => i -> m a -> m [a]
genericReplicateM n = sequence . genericReplicate n

genericReplicateM_ :: (Monad m, Integral i) => i -> m a -> m ()
genericReplicateM_ n = sequence_ . genericReplicate n

--ken


More information about the Libraries mailing list