Skip to content
vic

dotty-cps-async/dotty-cps-async

experimental CPS transformer for dotty

dotty-cps-async/dotty-cps-async.json
{
"createdAt": "2020-01-01T06:44:14Z",
"defaultBranch": "master",
"description": "experimental CPS transformer for dotty",
"fullName": "dotty-cps-async/dotty-cps-async",
"homepage": "",
"language": "Scala",
"name": "dotty-cps-async",
"pushedAt": "2025-11-15T16:30:56Z",
"stargazersCount": 192,
"topics": [
"async",
"continuation",
"cps",
"dotty",
"monad",
"scala",
"scala-async",
"scala-js",
"transformation"
],
"updatedAt": "2025-11-19T22:30:15Z",
"url": "https://github.com/dotty-cps-async/dotty-cps-async"
}

I’m the creator of this project. My country, Ukraine, is being invaded by the Russian Federation, right now. If you want to help my country to fight, consider donating to charity supporting Ukrainian army. More options is described on support ukraine site.

This is the implementation of async/await transformation for [Scala 3][scala3] (Dotty), based on an optimized version of [CPS] (Continuation Passing Style) transformation, where the continuation is ‘pushed’ to the monad.

  • Full support of all Scala language constructs in async/await block.
  • Pluggable monad interface:
    • An await monad can be any trait for which it is possible to implement CpsAsyncMonad type class. You can provide those methods for your favorite monad.
  • Limited support of high-order functions:
    • urls.map(fetchData(_))(await _ ) is an idiomatic way to fetch data for all items in parallel.
    • An application developer or library author can provide ‘shifted’ implementation of the own high-order functions.
  • Optional features, which enhance ergonomics in some cases, such as automatic coloring and handling discarded values
  • Optional [SIP-22 compatible API][sip_22].

For more details, please, read the documentation at https://dotty-cps-async.github.io/dotty-cps-async/.

[cps] !: https://en.wikipedia.org/wiki/Continuation-passing_style [scala3] !: https://dotty.epfl.ch/ [sip_22] !: https://docs.scala-lang.org/sips/async.html