https://kotlinlang.org logo
#arrow
Title
j

jtonic

04/22/2018, 8:17 AM
Dear arrow/kt-fp community, Today I tried the latest version of arrow - 0.7.0. For one who is on the path of learning FP (by the book) by using arrow the breaking changes are not quite easy to address. - It was easy to address the fact that Try, Success, Failure were moved from arrow.data to arrow.core. - But for the following I found out no solution: 1.
Copy code
import arrow.syntax.tuples.plus; // not resolved. Where it was moved in?

        val salary: Salary = 2_500
        val t2: Tuple2<String, Salary> = "Antonel" toT salary
        val age: Age = 48
        val t3 = t2 + age // I didn't find plus operator fun for transforming Tuple2 into Tuple3
2. ev() not found
Copy code
import arrow.core.*
import arrow.core.Tuple2
import arrow.core.monad
import arrow.core.toT
import arrow.typeclasses.binding

Try.monad().binding {
    val v1 = pure1(1)
    val v2 = inpure2(v1).bind()
    val v3 = pure3(v2)
    val result = pure4(v3)
    result
}.ev().fold( { -1 }, { it } ) shouldBe 5  // ev() not found -> compilation error
I am on https://www.pacoworks.com/2018/04/09/arrow-0-7-a-quality-of-life-upgrade/ but still struggle with the notations/APIs. Thank you very much in advance for you guidance.