how can I return a raw value as the left value whe...
# arrow
s
how can I return a raw value as the left value when inside an either block? E.g.
Copy code
fun test() = either<String, SomeObject> {
    val someString = ""
    // how can I return 'someString' as the left value of this either?
}
w
I use
someString.left().bind()
, not sure if there is a better way.
a
You can also use
suspend fun ensure(value: Boolean, orLeft: () -> E)
in
EitherEffect