[Haskell-cafe] Data.Sequence and replicateM

Petr P petr.mvd at gmail.com
Fri Jan 25 19:37:44 CET 2013


2013/1/25 Daniel Díaz Casanueva <dhelta.diaz at gmail.com>

>
> Yes, you're right about the type context. I always forget that Functor is
> not a superclass of Monad. Anyway, the `fmap` can be done only with `Monad`
> in the context.
>
>
Instead of adding `Functor m` constraint you could write just

    f n = liftM Seq.fromList . replicateM n

Best regards,
Petr Pudlak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130125/9ff1a866/attachment.htm>


More information about the Haskell-Cafe mailing list