Can't understand, why the brackets around `a` solv...
# arrow
r
Can't understand, why the brackets around
a
solve the compile-time problem:
Copy code
binding {
  val (a) = IO.invoke { 1 }
  a + 1
}.fix().unsafeRunSync()
// 2
k
you can destructure things in Kotlin with parenthesis:
Copy code
data class Test(val a: Int, val b: String = "Hello")

val (num, str) = Test(-1)
println("value is: $str") // prints value is: Hello
this is due to
.component1()
/
.component2()
declaration, you can actually implement it by your classes as well to have this functionality 🙂
😯 1
s
There are 3 ways of to extract a value.
IO { 1  }.bind()
with
!IO { 1 }
, and
component1
operator overload.
!
is achieved with overload the
not
operator.
r
! Is the preferred way currently in arrow to destructure effects and the component syntax will be removed because its problematic in lists
🔝 1