should it be raiseException or raiseError? cc <@U0...
# arrow
p
should it be raiseException or raiseError? cc @aballano and @simon.vergauwen for opinion
h
For that, I meant version with raiseError. I have seen that there is already with raiseException 😉
p
ye I imagined 😄
a
I guess Simon knows better, but from my understanding it should be raiseError without the mapping 🤔
p
toIO
and
toIOException
to distiguish
IO<Throwable, A>
and
IO<Nothing, A>
for example
👌 1
@Hiosdra you could make a PR for that
h
@pakoito Thank you, I will be glad to do this today evening. You mean to rename actual:
Copy code
fun <A> Either<Throwable, A>.toIO(): IO<Nothing, A>
to
toIOException
Also to create and test:
Copy code
fun <E, A> Either<E, A>.toIO(): IO<E, A> =
  fold({ IO.raiseError(it) }, { IO.just(it) })
p
correct!
so there should be 3 in the end:
oh nevermind, just 2
the third one can be made by using map or mapLeft first
h
Ok, I will make pull request after my work 😉
p
Copy code
fun <E, A> Either<Throwable, A>.toIO(f: (Throwable) -> E): IO<E, A>
cool, thanks 😄
h
@pakoito https://github.com/arrow-kt/arrow/pull/2003 Can you look at it?