MP Data Types 0.1.3 Release

Features

Introduction of coroutine comprehension for Either. It was not possible to use the either comprehension with coroutines. A sample test is below.

  fun testAsyncUnHappyComprehension() = runBlocking {
    val rsp = Either.comprehensionAsync<String, Int> {
      val a = GlobalScope.async { Either.right(1) }
      val b = GlobalScope.async {
        delay(500)
        Either.right(2)
      }
      val c = GlobalScope.async {
        delay(500)
        Either.left<String>("Failure")
      }
      val futureD = GlobalScope.async {
        Either.right<Int>(4)
      }
      val d = (futureD)
      val (possibleA) = !a
      val (possibleB) = !b
      val (possibleC) = !c
      possibleA + possibleB + 1
    }
    assertTrue { rsp.isLeft() }
    assertTrue { rsp.forceLeft() == "Failure" }
}
  • Companion object function comprehensionAsync off of Either type.

Public Facing

  • Support for IR and Legacy compiler
  • JDK Compilation target upgraded to 11
  • Kotlin API Version changed to 1.4

Contributor Facing

  • Upgrade Kotlin 1.3.61 -> 1.4.31
  • Upgrade Dokka 0.10.0 to 1.4.20
  • Upgrade Serialization  1.1.0
  • Upgrade gradle wrapper 6.2.2 to 6.8.2
  • Switch from groovy gradle to kotlin script gradle
  • Enabling ktlint and editor config support