Hey <@U4DB4PJ72> Like Alberto suggested if you’re...
# arrow
s
Hey @melatonina Like Alberto suggested if you’re working concretely with
Either
it’s easier to just use
Either.fx
. In case you want to write polymorphic code using the typeclasses, it requires a slightly different syntax. Since depending on which typeclass you use,
Monad
,
MonadThrow
,
Async
,
Concurrent
etc you get a more or less powerful DSL enabled.
Copy code
Either.monad<Exception>().fx.monad {
  !mapN(fa, fb) { a, b -> a + b }
}

IO.concurrent().fx.concurrent {
  // Concurrent & parallel DSL
  !parMapN(fa, fb) { a, b -> a + b } 
}
Since we already know what the most powerful powers are for
Either
or
IO
we can already hide that additional boilerplate for you. We achieve these different powers by using different receivers in the DSL.
MonadSyntax
for
Either
&
ConcurrentSyntax
for
IO
in this example.
🔝 4