I want to execute a list of of `IO` actions all t...
# arrow
m
I want to execute a list of of
IO
actions all together with one call to
unsafeRunSync
. I know in Haskell there is
sequence
- is there a similar construct in Arrow?
j
sequence
in haskell comes from the
Traverse
typeclass and is defined as
traverse id
or similar. We have the same construct and it should exist for every datatype that has an instance of
Traverse
I would love to link some docs but the pr for it is wip 🙈 The code for it is here https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-core-data/src/main/kotlin/arrow/typeclasses/Traverse.kt
m
Thanks, Jannis! No doc needed (as far as I can see now). Using
ListK
should do the job ...
👍 5
a
@Michael Marth I believe what you're needing is just
parSequence
👍 1
listOf(IO { 1 }, IO { 2 }).parSequence(...)
m
Yes, that's actually what I have ended up with 🙂
👏 1