Is there a plan to add a a function on `Effect` li...
# arrow
a
Is there a plan to add a a function on
Effect
like
leftIfNull
for
Either
? Right now I do:
Copy code
effect {
    ensureNotNull(someEffect.bind()) { SomeError("…") }
}
which seems verbose
s
Good morning Romain. Currently, there are no such plans, because we want to keep the API of Arrow slim.
For the same reasons we've not added
traverse
etc for
Effect
yet since one can simply do.
Copy code
effect {
  values.map { it.bind() }
}
Keep in mind that with context receivers you'll be able to do this.
Copy code
context(EffectScope<SomeError>)
suspend fun myCode(): Int =
  ensureNotNull(someEffect.bind()) { SomeError("…") }
a
Thanks Simon! One more reason to wait for context receivers then.
👍 1
s
My pleasure Romain! We're also always eager to receive feedback on community used operators though, so if something is popular enough then we can definitely add it into Arrow