[Haskell-beginners] get rid of IO in [IO XXX]

Mihai Maruseac mihai.maruseac at gmail.com
Mon Sep 4 16:09:07 UTC 2017


Hi,

Use sequence. It has type t (m a) -> m (t a) where m is a Monad (like
IO) and t is a Traversable (like the list).

Documentation: http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html#v:sequence

I got to it using Hoogle:
https://www.haskell.org/hoogle/?hoogle=%5BIO+a%5D+-%3E+IO+%5Ba%5D

On Mon, Sep 4, 2017 at 9:04 AM,  <info at maximka.de> wrote:
> What is the way to transform a list of [IO XXX] type to [XXX]?
>
> Thanks,
> Alexei
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



-- 
Mihai Maruseac (MM)
"If you can't solve a problem, then there's an easier problem you can
solve: find it." -- George Polya


More information about the Beginners mailing list