A repo to experiment with Continuation R, A implementations in Kotlin

Related tags

Kotlin Continuation
Overview

Cont

Cont represents a function of suspend () -> A that can fail with R (and Throwable), so it's defined by suspend fun fold(f: suspend (R) -> B, g: suspend (A) -> B): B.

So to construct a Cont we simply call the cont { } DSL, which exposes a rich syntax through the lambda receiver suspend ContEffect .() -> A .

What is interesting about the Cont type is that it doesn't rely on any wrappers such as Either, Ior or Validated. Instead Cont represents a suspend function, and only when we call fold it will actually create a Continuation and runs the computation (without intrecepting). This makes Cont a very efficient generic runtime.

Writing a program with Cont

Let's write a small program to read a file from disk, and instead of having the program work exception based we want to turn it into a polymorphic type-safe program.

We'll start by defining a small function that accepts a String, and does some simply validation to check that the path is not empty. If the path is empty, we want to program to result in EmptyPath. So we're immediately going to see how we can raise an error of any arbitrary type R by using the function shift. The name shift comes shifting (or changing, especially unexpectedly), away from the computation and finishing the Continuation with R.

import arrow.Cont
import arrow.cont

object EmptyPath

fun readFile(path: String): Cont<EmptyPath, Unit> = cont {
  if (path.isNotEmpty()) shift(EmptyPath) else Unit
}

Here we see how we can define a Cont which has EmptyPath for the shift type R, and Unit for the success type A.

Patterns like validating a Boolean is very common, and the Cont DSL offers utility functions like kotlin.require and kotlin.requireNotNull. They're named ensure and ensureNotNull to avoid conflicts with the kotlin namespace. So let's rewrite the function from above to use the DSL instead.

fun readFile2(path: String?): Cont<EmptyPath, Unit> = cont {
  ensure(!path.isNullOrBlank()) { EmptyPath }
}

You can get the full code here.

Now that we have the path, we can read from the File and return it as a domain model Content. We also want to take a look at what exceptions reading from a file might occur FileNotFoundException & SecurityError, so lets make some domain errors for those too. Grouping them as a sealed interface is useful since that way we can resolve all errors in a type safe manner.

import arrow.Cont
import arrow.cont
import arrow.ensureNotNull
import arrow.core.None
import java.io.File
import java.io.FileNotFoundException
import kotlinx.coroutines.runBlocking

@JvmInline
value class Content(val body: List<String>)

sealed interface FileError
@JvmInline value class SecurityError(val msg: String?) : FileError
@JvmInline value class FileNotFound(val path: String) : FileError
object EmptyPath : FileError {
  override fun toString() = "EmptyPath"
}

We can finish our function, but we need to refactor our return value from Unit to Content and our error type from EmptyPath to FileError.

fun readFile(path: String?): Cont<FileError, Content> = cont {
  ensureNotNull(path) { EmptyPath }
  ensure(path.isNotEmpty()) { EmptyPath }
  try {
    val lines = File(path).readLines()
    Content(lines)
  } catch (e: FileNotFoundException) {
    shift(FileNotFound(path))
  } catch (e: SecurityException) {
    shift(SecurityError(e.message))
  }
}

The readFile function defines a suspend fun that will return:

  • the Content of a given path
  • a FileError
  • An unexpected fatal error (OutOfMemoryException)

Since these are the properties of our Cont function, we can turn it into a value.

null }, { it }).also(::println) } ">
fun main() = runBlocking<Unit> {
  readFile("").toEither().also(::println)
  readFile("not-found").toValidated().also(::println) 
  readFile("gradle.properties").toIor().also(::println)
  readFile("not-found").toOption { None }.also(::println)
  readFile("nullable").fold({ _: FileError -> null }, { it }).also(::println)
}

You can get the full code here.

Either.Left(EmptyPath)
Validated.Invalid(FileNotFound(path=not-found))
Ior.Left(FileNotFound(path=gradle.properties))
Option.None
null

The functions above our available out of the box, but it's easy to define your own extension functions in terms of fold. Implementing the toEither() operator is as simple as:

import arrow.Cont
import arrow.core.identity
import arrow.core.Either
import arrow.core.Option
import arrow.core.None
import arrow.core.Some

suspend fun <R, A> Cont<R, A>.toEither(): Either<R, A> =
  fold({ Either.Left(it) }) { Either.Right(it) }

suspend fun <A> Cont<None, A>.toOption(): Option<A> =
  fold(::identity) { Some(it) }

You can get the full code here.

Adding your own syntax to ContEffect is tricky atm, but will be easy once "Multiple Receivers" become available.

context(ContEffect
    
     )
suspend fun 
     
       Either
      
       .bind(): A =
  when (this) {
    is Either.Left -> shift(value)
    is Either.Right -> value
  }

context(ContEffect
       
        )
fun 
         Option
        .bind(): A = fold({ shift(it) }, ::identity) 
       
      
     
    

Handling errors

Handling errors of type R is the same as handling errors for any other data type in Arrow. Cont offers handleError, handleErrorWith, redeem, redeemWith and attempt.

As you can see in the examples below it is possible to resolve errors of R or Throwable in Cont in a generic manner. There is no need to run Cont into Either before you can access R, you can simply call the same functions on Cont as you would on Either directly.

= failed.handleError { it.length } val newError: Cont , Int> = failed.handleErrorWith { str -> cont { shift(str.reversed().toList()) } } val redeemed: Cont = failed.redeem({ str -> str.length }, ::identity) val captured: Cont > = cont { throw RuntimeException("Boom") }.attempt() fun main() = runBlocking { println(failed.toEither()) println(resolved.toEither()) println(newError.toEither()) println(redeemed.toEither()) println(captured.toEither()) } ">
import arrow.Cont
import arrow.cont
import arrow.core.identity
import kotlinx.coroutines.runBlocking

val failed: Cont<String, Int> =
  cont { shift("failed") }

val resolved: Cont<Nothing, Int> =
  failed.handleError { it.length }

val newError: Cont<List<Char>, Int> =
  failed.handleErrorWith { str ->
    cont { shift(str.reversed().toList()) }
  }

val redeemed: Cont<Nothing, Int> =
  failed.redeem({ str -> str.length }, ::identity)

val captured: Cont<String, Result<Int>> = cont<String, Int> {
  throw RuntimeException("Boom")
}.attempt()

fun main() = runBlocking<Unit> {
  println(failed.toEither())
  println(resolved.toEither())
  println(newError.toEither())
  println(redeemed.toEither())
  println(captured.toEither())
}

You can get the full code here.

Either.Left(failed)
Either.Right(6)
Either.Left([d, e, l, i, a, f])
Either.Right(6)
Either.Right(Failure(java.lang.RuntimeException: Boom))

Note: Handling errors can also be done with try/catch but this is not recommended, it uses CancellationException which is used to cancel Coroutines and is advised not to capture in Kotlin. The CancellationException from Cont is ShiftCancellationException, this type is public so you can distinct the exceptions if necessary.

Structured Concurrency

Cont relies on kotlin.cancellation.CancellationException to shift error values of type R inside the Continuation since it effectively cancels/short-circuits it. For this reason shift adheres to the same rules as Structured Concurrency

Let's overview below how shift behaves with the different concurrency builders from Arrow Fx & KotlinX Coroutines.

Arrow Fx Coroutines

All operators in Arrow Fx Coroutines run in place, so they have no way of leaking shift. It's there always safe to compose cont with any Arrow Fx combinator. Let's see some small examples below.

parZip

int } }.fold(::println, ::println) // "error" ">
import arrow.cont
import arrow.fx.coroutines.parZip
import kotlinx.coroutines.delay

suspend fun parZip(): Unit = cont<String, Int> {
  parZip({
   delay(1_000_000) // Cancelled by shift 
  }, { shift<Int>("error") }) { _, int -> int }
}.fold(::println, ::println) // "error"

You can get the full code here.

parTraverse

import arrow.cont
import arrow.fx.coroutines.parTraverse
import kotlinx.coroutines.delay

suspend fun parTraverse() = cont<String, List<Int>> {
 (0..100).parTraverse { index -> // running tasks
   if(index == 50) shift<Int>("error")
   else index.also { delay(1_000_000) } // Cancelled by shift
 }
}.fold(::println, ::println) // "error"

You can get the full code here.

raceN

result from race into Int }.fold(::println, ::println) // "error" ">
import arrow.cont
import arrow.core.merge
import arrow.fx.coroutines.raceN
import kotlinx.coroutines.delay

suspend fun race() = cont<String, Int> {
  raceN({
   delay(1_000_000) // Cancelled by shift
   5
  }) { shift<Int>("error") }
   .merge() // Flatten Either
    
      result from race into Int
    
}.fold(::println, ::println) // "error"

You can get the full code here.

bracketCase / Resource

// some logic shift("file doesn't contain right content") }, release = { reader, exitCase -> reader.close() println(exitCase) // ExitCase.Cancelled(ShiftCancellationException("Shifted Continuation")) } ) }.fold(::println, ::println) // "file doesn't contain right content" // Available from Arrow 1.1.x fun Resource.releaseCase(releaseCase: (A, ExitCase) -> Unit): Resource = flatMap { a -> Resource({ a }, releaseCase) } fun bufferedReader(path: String): Resource = Resource.fromAutoCloseable { File(path).bufferedReader() }.releaseCase { _, exitCase -> println(exitCase) } suspend fun resource() = cont { bufferedReader("gradle.properties").use { reader -> // some logic shift("file doesn't contain right content") } // ExitCase.Cancelled(ShiftCancellationException("Shifted Continuation")) printed from release } ">
import arrow.cont
import arrow.fx.coroutines.ExitCase
import arrow.fx.coroutines.bracketCase
import arrow.fx.coroutines.Resource
import arrow.fx.coroutines.fromAutoCloseable
import java.io.BufferedReader
import java.io.File

suspend fun bracketCase() = cont<String, Int> {
  bracketCase(
   acquire = { File("gradle.properties").bufferedReader() },
   use = { reader -> 
    // some logic
    shift("file doesn't contain right content")
   },
   release = { reader, exitCase -> 
     reader.close()
     println(exitCase) // ExitCase.Cancelled(ShiftCancellationException("Shifted Continuation"))
   }
  )
}.fold(::println, ::println) // "file doesn't contain right content"

// Available from Arrow 1.1.x
fun <A> Resource.releaseCase(releaseCase: (A, ExitCase) -> Unit): Resource<A> =
  flatMap { a -> Resource({ a }, releaseCase) }

fun bufferedReader(path: String): Resource<BufferedReader> =
  Resource.fromAutoCloseable {
    File(path).bufferedReader()
  }.releaseCase { _, exitCase -> println(exitCase) }

suspend fun resource() = cont<String, Int> {
  bufferedReader("gradle.properties").use { reader ->
  // some logic
  shift("file doesn't contain right content")
 } // ExitCase.Cancelled(ShiftCancellationException("Shifted Continuation")) printed from release
}

You can get the full code here.

KotlinX

withContext

It's always safe to call shift from withContext since it runs in place, so it has no way of leaking shift. When shift is called from within withContext it will cancel all Jobs running inside the CoroutineScope of withContext.

import arrow.cont
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext

suspend fun withContext() = cont<String, Int> {
  withContext(Dispatchers.IO) {
    launch { delay(1_000_000) } // launch gets cancelled due to shift(FileNotFound("failure"))
    val sleeper = async { delay(1_000_000) } // async gets cancelled due to shift(FileNotFound("failure"))
    readFile("failure").bind()
    sleeper.await()
  }
}.fold(::println, ::println) // FileNotFound("failure")

async

When calling shift from async you should always call await, otherwise shift can leak out of its scope.

launch

NOTE Capturing shift into a lambda, and leaking it outside of Cont to be invoked outside will yield unexpected results. Below we capture shift from inside the DSL, and then invoke it outside its context `ContEffectz

leakedShift.invoke() }) ">
cont<String, suspend () -> Unit> {
 suspend { shift("error") }
}.fold({ }, { leakedShift -> leakedShift.invoke() })

The same violation is possible in all DSLs in Kotlin, including Structured Concurrency.

val leakedAsync = coroutineScope<suspend () -> Deferred<Unit>> {
  suspend {
    async {
      println("I am never going to run, until I get called invoked from outside")
    }
  }
}
leakedAsync.invoke().await()
Comments
  • Update all dependencies

    Update all dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/upload-artifact | action | patch | v2.3.0 -> v2.3.1 | | gradle (source) | | patch | 7.3.1 -> 7.3.3 | | org.jetbrains.kotlin.multiplatform | plugin | patch | 1.6.0 -> 1.6.10 | | io.kotest.multiplatform | plugin | patch | 5.0.1 -> 5.0.3 | | io.kotest:kotest-runner-junit5 | | patch | 5.0.1 -> 5.0.3 | | io.kotest:kotest-property | | patch | 5.0.1 -> 5.0.3 | | io.kotest:kotest-framework-engine | | patch | 5.0.1 -> 5.0.3 | | io.kotest:kotest-assertions-core | | patch | 5.0.1 -> 5.0.3 | | org.jetbrains.kotlinx:kotlinx-coroutines-test | | minor | 1.5.2 -> 1.6.0 | | org.jetbrains.kotlinx:kotlinx-coroutines-core | | minor | 1.5.2 -> 1.6.0 |


    Release Notes

    actions/upload-artifact

    v2.3.1

    Compare Source

    Fix for empty fails on Windows failing on upload #​281

    gradle/gradle

    v7.3.3

    This is a patch release for Gradle 7.3.

    It fixes the following issues:

    We recommend users upgrade to 7.3.3 instead of 7.3.

    Given the context of the Log4Shell vulnerability, make sure you take a look at our blog post on this topic.

    Upgrade Instructions

    Switch your build to use Gradle 7.3.3 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.3.3
    

    See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.3.3.

    Reporting Problems

    If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.

    v7.3.2

    This is a patch release for Gradle 7.3.

    It fixes the following issues:

    • #​19300 Mitigations for log4j vulnerability in Gradle builds
    • #​19257 Incremental java compilation fails when renaming classname with $ character

    We recommend users upgrade to 7.3.2 instead of 7.3.

    Given the context of the Log4Shell vulnerability, make sure you take a look at our blog post on this topic.

    Upgrade Instructions

    Switch your build to use Gradle 7.3.2 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.3.2
    

    See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.3.2.

    Reporting Problems

    If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.

    kotest/kotest

    v5.0.3

    v5.0.2

    Kotlin/kotlinx.coroutines

    v1.6.0

    Compare Source

    Note that this is a full changelog relative to the 1.5.2 version. Changelog relative to 1.6.0-RC3 can be found at the end.

    kotlinx-coroutines-test rework
    Dispatchers
    • Introduced CoroutineDispatcher.limitedParallelism that allows obtaining a view of the original dispatcher with limited parallelism (#​2919).
    • Dispatchers.IO.limitedParallelism usages ignore the bound on the parallelism level of Dispatchers.IO itself to avoid starvation (#​2943).
    • Introduced new Dispatchers.shutdown method for containerized environments (#​2558).
    • newSingleThreadContext and newFixedThreadPoolContext are promoted to delicate API (#​2919).
    Breaking changes
    • When racing with cancellation, the future builder no longer reports unhandled exceptions into the global CoroutineExceptionHandler. Thanks @​vadimsemenov! (#​2774, #​2791).
    • Mutex.onLock is deprecated for removal (#​2794).
    • Dispatchers.Main is now used as the default source of time for delay and withTimeout when present(#​2972).
      • To opt-out from this behaviour, kotlinx.coroutines.main.delay system property can be set to false.
    • Java target of coroutines build is now 8 instead of 6 (#​1589).
    • Source-breaking change: extension collect no longer resolves when used with a non-in-place argument of a functional type. This is a candidate for a fix, uncovered after 1.6.0, see #​3107 for the additional details.
    Bug fixes and improvements
    • Kotlin is updated to 1.6.0.
    • Kotlin/Native new memory model is now supported in regular builds of coroutines conditionally depending on whether kotlin.native.binary.memoryModel is enabled (#​2914).
    • Introduced CopyableThreadContextElement for mutable context elements shared among multiple coroutines. Thanks @​yorickhenning! (#​2893).
    • transformWhile, awaitClose, ProducerScope, merge, runningFold, runingReduce, and scan are promoted to stable API (#​2971).
    • SharedFlow.subscriptionCount no longer conflates incoming updates and gives all subscribers a chance to observe a short-lived subscription (#​2488, #​2863, #​2871).
    • Flow exception transparency mechanism is improved to be more exception-friendly (#​3017, #​2860).
    • Cancellation from flat* operators that leverage multiple coroutines is no longer propagated upstream (#​2964).
    • SharedFlow.collect now returns Nothing (#​2789, #​2502).
    • DisposableHandle is now fun interface, and corresponding inline extension is removed (#​2790).
    • FlowCollector is now fun interface, and corresponding inline extension is removed (#​3047).
    • Deprecation level of all previously deprecated signatures is raised (#​3024).
    • The version file is shipped with each JAR as a resource (#​2941).
    • Unhandled exceptions on K/N are passed to the standard library function processUnhandledException (#​2981).
    • A direct executor is used for Task callbacks in kotlinx-coroutines-play-services (#​2990).
    • Metadata of coroutines artifacts leverages Gradle platform to have all versions of dependencies aligned (#​2865).
    • Default CoroutineExceptionHandler is loaded eagerly and does not invoke ServiceLoader on its exception-handling path (#​2552).
    • Fixed the R8 rules for ServiceLoader optimization (#​2880).
    • Fixed BlockHound integration false-positives (#​2894, #​2866, #​2937).
    • Fixed the exception handler being invoked several times on Android, thanks to @​1zaman (#​3056).
    • SendChannel.trySendBlocking is now available on Kotlin/Native (#​3064).
    • The exception recovery mechanism now uses ClassValue when available (#​2997).
    • JNA is updated to 5.9.0 to support Apple M1 (#​3001).
    • Obsolete method on internal Delay interface is deprecated (#​2979).
    • Support of deprecated CommonPool is removed.
    • @ExperimentalTime is no longer needed for methods that use Duration (#​3041).
    • JDK 1.6 is no longer required for building the project (#​3043).
    • New version of Dokka is used, fixing the memory leak when building the coroutines and providing brand new reference visuals (https://kotlin.github.io/kotlinx.coroutines/) (#​3051, #​3054).
    Changelog relative to version 1.6.0-RC3
    • Restored MPP binary compatibility on K/JS and K/N (#​3104).
    • Fixed Dispatchers.Main not being fully initialized on Android and Swing (#​3101).

    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies to v0.6.0

    Update all dependencies to v0.6.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | io.arrow-kt.arrow-gradle-config-nexus | 0.5.1 -> 0.6.0 | age | adoption | passing | confidence | | io.arrow-kt.arrow-gradle-config-formatter | 0.5.1 -> 0.6.0 | age | adoption | passing | confidence |


    Release Notes

    arrow-kt/arrow-gradle-config

    v0.6.0

    Compare Source


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update actions/upload-artifact action to v2.3.0

    Update actions/upload-artifact action to v2.3.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/upload-artifact | action | minor | v2.2.4 -> v2.3.0 |


    Release Notes

    actions/upload-artifact

    v2.3.0

    Compare Source

    • Optimizations for faster uploads of larger files that are already compressed
    • Significantly improved logging when there are chunked uploads
    • Clarifications in logs around the upload size and prohibited characters that aren't allowed in the artifact name or any uploaded files
    • Various other small bugfixes & optimizations

    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency gradle to v7.3.1

    Update dependency gradle to v7.3.1

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Update | Change | |---|---|---| | gradle (source) | patch | 7.3 -> 7.3.1 |


    Release Notes

    gradle/gradle

    v7.3.1

    This is a patch release for Gradle 7.3.

    It fixes the following issues:

    • #​19058 Consider reverting breaking change about test configuration
    • #​19067 Fix multiple annotation processing issues discovered by Micronaut

    We recommend users upgrade to 7.3.1 instead of 7.3.

    Upgrade Instructions

    Switch your build to use Gradle 7.3.1 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.3.1
    

    See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.3.1.

    Reporting Problems

    If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update plugin kotest-multiplatform to v5.0.1

    Update plugin kotest-multiplatform to v5.0.1

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | io.kotest.multiplatform | 5.0.0.6 -> 5.0.1 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies to v5.0.1

    Update all dependencies to v5.0.1

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | io.kotest:kotest-runner-junit5 | 5.0.0 -> 5.0.1 | age | adoption | passing | confidence | | io.kotest:kotest-assertions-core | 5.0.0 -> 5.0.1 | age | adoption | passing | confidence |


    Release Notes

    kotest/kotest

    v5.0.1

    https://kotest.io/docs/changelog.html


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update plugin kover to v0.4.4

    Update plugin kover to v0.4.4

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.jetbrains.kotlinx.kover | 0.4.3 -> 0.4.4 | age | adoption | passing | confidence |


    Release Notes

    Kotlin/kotlinx-kover

    v0.4.4

    ===================

    Bugfixes
    • Fixed escape characters in intellijreport.json (#​82)

    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies to v5.0.0.RC2

    Update all dependencies to v5.0.0.RC2

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | io.kotest:kotest-runner-junit5 | 5.0.0.RC -> 5.0.0.RC2 | age | adoption | passing | confidence | | io.kotest:kotest-assertions-core | 5.0.0.RC -> 5.0.0.RC2 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies to v1.6.0

    Update all dependencies to v1.6.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.jetbrains.dokka | 1.5.31 -> 1.6.0 | age | adoption | passing | confidence | | org.jetbrains.dokka:dokka-core | 1.5.31 -> 1.6.0 | age | adoption | passing | confidence |


    Configuration

    ?? Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update actions/cache action to v2.1.7

    Update actions/cache action to v2.1.7

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/cache | action | patch | v2.1.6 -> v2.1.7 |


    Release Notes

    actions/cache

    v2.1.7

    Compare Source

    Support 10GB cache upload using the latest version 1.0.8 of @actions/cache


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies

    Update all dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | gradle (source) | | minor | 7.2 -> 7.3 | | io.kotest.multiplatform | plugin | patch | 5.0.0.RC -> 5.0.0.6 |


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies (major)

    Update all dependencies (major)

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/cache | action | major | v2.1.7 -> v3.0.0 | | actions/checkout | action | major | v2 -> v3 | | actions/upload-artifact | action | major | v2.3.1 -> v3.0.0 |


    Release Notes

    actions/cache

    v3.0.0

    Compare Source

    • This change adds a minimum runner version(node12 -> node16), which can break users using an out-of-date/fork of the runner. This would be most commonly affecting users on GHES 3.3 or before, as those runners do not support node16 actions and they can use actions from github.com via github connect or manually copying the repo to their GHES instance.

    • Few dependencies and cache action usage examples have also been updated.

    actions/checkout

    v3

    Compare Source

    actions/upload-artifact

    v3.0.0

    Compare Source

    What's Changed
    • Update default runtime to node16 (#​293)
    • Update package-lock.json file version to 2 (#​302)
    Breaking Changes

    With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies

    Update all dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---|---|---| | gradle (source) | | minor | 7.3.3 -> 7.4.1 | age | adoption | passing | confidence | | org.jetbrains.kotlinx.kover | plugin | minor | 0.4.4 -> 0.5.0 | age | adoption | passing | confidence | | io.kotest.multiplatform | plugin | minor | 5.0.3 -> 5.2.1 | age | adoption | passing | confidence | | io.kotest:kotest-runner-junit5 | | minor | 5.0.3 -> 5.2.1 | age | adoption | passing | confidence | | io.kotest:kotest-property | | minor | 5.0.3 -> 5.2.1 | age | adoption | passing | confidence | | io.kotest:kotest-framework-engine | | minor | 5.0.3 -> 5.2.1 | age | adoption | passing | confidence | | io.kotest:kotest-assertions-core | | minor | 5.0.3 -> 5.2.1 | age | adoption | passing | confidence | | org.jetbrains.dokka | plugin | patch | 1.6.0 -> 1.6.10 | age | adoption | passing | confidence | | org.jetbrains.dokka:dokka-core | | patch | 1.6.0 -> 1.6.10 | age | adoption | passing | confidence | | io.arrow-kt.arrow-gradle-config-nexus | plugin | minor | 0.6.0 -> 0.10.0 | age | adoption | passing | confidence | | io.arrow-kt.arrow-gradle-config-formatter | plugin | minor | 0.6.0 -> 0.10.0 | age | adoption | passing | confidence |


    Release Notes

    gradle/gradle

    v7.4.1

    This is a patch release for Gradle 7.4.

    See the list of fixed issues: https://docs.gradle.org/7.4.1/release-notes.html

    We recommend users upgrade to 7.4.1 instead of 7.4.

    Upgrade Instructions

    Switch your build to use Gradle 7.4.1 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.4.1
    

    See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.4.1.

    Reporting Problems

    If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.

    Kotlin/kotlinx-kover

    v0.5.0

    =================== Note that this is a full changelog relative to 0.4.4 version. Changelog relative to 0.5.0-RC2 can be found at the end of the changelog.

    Features
    • Added reports filtering (#​17)
    • Disabled running of all test tasks for single-project Kover tasks (#​114)
    • Implemented aggregated multi-project report (#​20, #​43)
    • Unified coverage agents filters. Now only the characters '*' or '?' are used as wildcards for both IntelliJ and JaCoCo agents. Regular expressions are no longer supported by the IntelliJ agent as filters of instrumented classes. (#​21)
    • Tasks for verification and reporting for single Gradle project were renamed according to the template like koverXmlReport -> koverXmlProjectReport
    • The isEnabled property has been renamed to isDisabled in extensions KoverExtension and KoverTaskExtension to make their purpose more obvious
    • The term module has been replaced with project for compatibility with Gradle terminology
    • Added the ability to disable the Kover for the specified Gradle project
    • Made tasks cache relocatable (#​85)
    • Improved checks of disabled plugin before running Kover tasks
    • Upgraded IntelliJ Engine minimal version to 1.0.647
    • Upgraded IntelliJ Engine default version to 1.0.656
    Bugfixes
    • Added support of parallel tests execution (#​113)
    • Removed checking of parent projects for re-apply of the plugin (#​116)
    • Added property to exclude Android classes from the instrumentation (#​89)
    • Kotlin Multiplatform plugin adapter rewritten to use reflection (#​100)
    IntelliJ Agent Features (version 1.0.656)
    • Added the ability to count JVM instructions
    • Fixed getting into the report of objects and sealed classes
    • Added an excluding from the report of functions marked by Deprecated annotation with HIDDEN and ERROR levels
    Internal features
    • Added functional test on branch counter
    • Added functional tests on instruction counter
    Changelog relative to version 0.5.0-RC2
    Features
    • Improved checks of disabled plugin before running Kover tasks
    • Upgraded IntelliJ Engine default version to 1.0.656
    Bugfixes
    • Added support of parallel tests execution (#​113)
    • Removed checking of parent projects for re-apply of the plugin (#​116)
    IntelliJ Agent Features (version 1.0.656)
    • Added the ability to count JVM instructions
    • Fixed getting into the report of objects and sealed classes
    • Added an excluding from the report of functions marked by Deprecated annotation with HIDDEN and ERROR levels
    Internal features
    • Added functional test on branch counter
    • Added functional tests on instruction counter
    kotest/kotest

    v5.2.1

    v5.2.0

    Kotlin/dokka

    v1.6.10

    Changes

    • Support Kotlin 1.6.10
    • Add a sample project for versioning multi-module (https://github.com/Kotlin/dokka/pull/2170)

    Bugfixes

    • Fix various java.util.zip.ZipException for JS dependencies (https://github.com/Kotlin/dokka/pull/2258)
    • Fix handling of Description Lists (<dl>) used in JavaDocs (https://github.com/Kotlin/dokka/pull/2259)
    • Fix for "repositories not defined" issue in versioning multimodule example (https://github.com/Kotlin/dokka/pull/2263), thanks @​rajdeep1008!
    • Fix multiple rendering issues for "See Also" block for html format (https://github.com/Kotlin/dokka/pull/2267)
    • Fix sample body not being embedded to documentation (https://github.com/Kotlin/dokka/pull/2216)

    Maintenance

    • Update npm dependencies (https://github.com/Kotlin/dokka/pull/2251)
    • Bump de.undercouch.download to 4.1.2 (https://github.com/Kotlin/dokka/pull/2268)
    • Bump kotlinx.coroutines to 1.6.0 in integration tests (https://github.com/Kotlin/dokka/pull/2276)
    arrow-kt/arrow-gradle-config

    v0.10.0

    Compare Source

    v0.9.0

    Compare Source

    v0.8.2

    Compare Source


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue provides visibility into Renovate updates and their statuses. Learn more

    Repository problems

    These problems occurred while renovating this repository.

    • WARN: Error executing gradle wrapper update command. It can be not a critical one though.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    • [ ] Update all dependencies (gradle, org.jetbrains.kotlinx.kover, io.kotest.multiplatform, io.kotest:kotest-runner-junit5, io.kotest:kotest-property, io.kotest:kotest-framework-engine, io.kotest:kotest-assertions-core, org.jetbrains.dokka, org.jetbrains.dokka:dokka-core, io.arrow-kt.arrow-gradle-config-nexus, io.arrow-kt.arrow-gradle-config-formatter)
    • [ ] Update all dependencies (major) (actions/cache, actions/checkout, actions/upload-artifact)

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Owner
Simon Vergauwen
Functional Programmer in Kotlin & playing with all FP langs, @arrow_kt maintainer, Senior Software Engineer @47deg, Backend in @kotlin
Simon Vergauwen
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Bradley Campbell 492 Nov 17, 2022
A simplified interface for interacting with in-memory cache implementations on the JVM

This library provides a simplified interface for interacting with in-memory cache implementations on the JVM. Think: "SLF4J but for caching"

null 5 Nov 29, 2022
A thought experiment on architecture, object-oriented programming, and composability.

Journal3 There's barely anything special about the features that Journal3 is offering, it's literally yet another journaling application. What is spec

Hadi Satrio 7 Dec 13, 2022
A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

common sense OSS 0 Jan 20, 2022
Android app to fetch closed pull request of any public repo

Pullr Android app to fetch closed pull request of any public repo ?? Features Co

Sonu Sourav 0 Dec 26, 2021
Run Kotlin/JS libraries in Kotlin/JVM and Kotlin/Native programs

Zipline This library streamlines using Kotlin/JS libraries from Kotlin/JVM and Kotlin/Native programs. It makes it possible to do continuous deploymen

Cash App 1.5k Dec 30, 2022
Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Gérard Paligot 98 Dec 15, 2022
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️

kotlin-android-template ?? A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds. This templa

Nicola Corti 1.5k Jan 3, 2023
LifecycleMvp 1.2 0.0 Kotlin is MVP architecture implementation with Android Architecture Components and Kotlin language features

MinSDK 14+ Download Gradle Add to project level build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' }

Robert 20 Nov 9, 2021
Opinionated Redux-like implementation backed by Kotlin Coroutines and Kotlin Multiplatform Mobile

CoRed CoRed is Redux-like implementation that maintains the benefits of Redux's core idea without the boilerplate. No more action types, action creato

Kittinun Vantasin 28 Dec 10, 2022
👋 A common toolkit (utils) ⚒️ built to help you further reduce Kotlin boilerplate code and improve development efficiency. Do you think 'kotlin-stdlib' or 'android-ktx' is not sweet enough? You need this! 🍭

Toolkit [ ?? Work in progress ⛏ ?? ??️ ?? ] Snapshot version: repositories { maven("https://s01.oss.sonatype.org/content/repositories/snapshots") }

凛 35 Jul 23, 2022
An app architecture for Kotlin/Native on Android/iOS. Use Kotlin Multiplatform Mobile.

An app architecture for Kotlin/Native on Android/iOS. Use Kotlin Multiplatform Mobile. 项目架构主要分为原生系统层、Android/iOS业务SDK层、KMM SDK层、KMM业务逻辑SDK层、iOS sdkfra

libill 4 Nov 20, 2022
Provides Kotlin libs and some features for building Kotlin plugins

Kotlin Plugin Provides Kotlin libs and some features for building awesome Kotlin plugins. Can be used instead of CreeperFace's KotlinLib (don't use to

null 3 Dec 24, 2021
Notes-App-Kotlin - Notes App Built Using Kotlin

Notes-App-Kotlin Splash Screen Home Page Adding New Notes Filter Feature Search

Priyanka 4 Oct 2, 2022
Kotlin-client-dsl - A kotlin-based dsl project for a (Client) -> (Plugin) styled program

kotlin-client-dsl a kotlin-based dsl project for a (Client) -> (Plugin) styled p

jackson 3 Dec 10, 2022
A Kotlin Native program to show the time since a date, using Kotlin LibUI

TimeSince A Kotlin Native program to show the time since a date, using Kotlin LibUI Report Bug . Request Feature About The Project TimeSince is a Kotl

Russell Banks 2 May 6, 2022
RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

Alex 27 Jan 1, 2023
Create an application with Kotlin/JVM and Kotlin/JS, and explore features around code sharing, serialization, server- and client

Practical Kotlin Multiplatform on the Web 본 저장소는 코틀린 멀티플랫폼 기반 웹 프로그래밍 워크숍(강좌)을 위해 작성된 템플릿 프로젝트가 있는 곳입니다. 워크숍 과정에서 코틀린 멀티플랫폼을 기반으로 프론트엔드(front-end)는 Ko

SpringRunner 14 Nov 5, 2022
Create an application with Kotlin/JVM and Kotlin/JS, and explore features around code sharing, serialization, server- and client

Building a Full Stack Web App with Kotlin Multiplatform 본 저장소는 INFCON 2022에서 코틀린 멀티플랫폼 기반 웹 프로그래밍 핸즈온랩을 위해 작성된 템플릿 프로젝트가 있는 곳입니다. 핸즈온 과정에서 코틀린 멀티플랫폼을

Arawn Park 19 Sep 8, 2022