import Control.Monadimport qualified Data.Sequence as Seq
type Seq = Seq.Seq
f :: Monad m => Int -> m a -> m (Seq a)
f n = fmap Seq.fromList . replicateM n
g :: Monad m => Int -> m a -> m (Seq a)
g = Seq.replicateM
Maybe is just in my test case, where the Int argument is big and the monadic action short, but it looks to me that Data.Sequence.replicateM can be faster than it is right now.