Hello, everyone. Could you pls help me - just star...
# arrow
s
Hello, everyone. Could you pls help me - just started to use Arrow, so perhaps did something wrong (e.g. forgot to import something). My question is - why there is difference how Try works in Arrow and Scala ?
Copy code
import arrow.core.*
Try.invoke { "1" }.flatMap<Int> { throw IllegalArgumentException() }
java.lang.IllegalArgumentException

scala.util.Success<String>("a").flatMap<Int> { throw IllegalArgumentException() }
res28: scala.util.Try<kotlin.Int!>! = Failure(java.lang.IllegalArgumentException)
or in native Scala REPL:
Copy code
System.out.println(scala.util.Try("x").flatMap{ s => throw new java.lang.IllegalArgumentException(s) })
> Failure(java.lang.IllegalArgumentException: x)
r
In Kotlin unlike in Scala there is a single IO at the moment and it's safe to commit to it because is what arrow will be pushing for effectful code
👌 1