From ccd41717788bae8224271d32aa506247be2be36f Mon Sep 17 00:00:00 2001 From: "Rachel M. Carmena" Date: Thu, 8 Apr 2021 16:06:02 +0200 Subject: [PATCH] Documentation: update Arrow Meta example --- arrow-site/build.gradle | 8 ++++---- arrow-site/docs/_code/meta-home-code.md | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arrow-site/build.gradle b/arrow-site/build.gradle index e68bf6b0625..f64885d5a4c 100644 --- a/arrow-site/build.gradle +++ b/arrow-site/build.gradle @@ -20,10 +20,10 @@ apply from: "../arrow-libs/gradle/main.gradle" apply from: "../arrow-libs/gradle/subproject.gradle" dependencies { - compile "io.arrow-kt:arrow-optics:$VERSION_NAME" - compile "io.arrow-kt:arrow-core:$VERSION_NAME" - compile "io.arrow-kt:arrow-fx-coroutines:$VERSION_NAME" - compile "io.arrow-kt:arrow-fx-stm:$VERSION_NAME" + implementation "io.arrow-kt:arrow-optics:$VERSION_NAME" + implementation "io.arrow-kt:arrow-core:$VERSION_NAME" + implementation "io.arrow-kt:arrow-fx-coroutines:$VERSION_NAME" + implementation "io.arrow-kt:arrow-fx-stm:$VERSION_NAME" compileOnly "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" kapt "io.arrow-kt:arrow-meta:$VERSION_NAME" diff --git a/arrow-site/docs/_code/meta-home-code.md b/arrow-site/docs/_code/meta-home-code.md index b32cb725956..0a08d416465 100644 --- a/arrow-site/docs/_code/meta-home-code.md +++ b/arrow-site/docs/_code/meta-home-code.md @@ -2,17 +2,23 @@ library: meta --- ```kotlin +import arrow.meta.CliPlugin +import arrow.meta.Meta +import arrow.meta.invoke +import arrow.meta.quotes.Transform +import arrow.meta.quotes.namedFunction + //sampleStart val Meta.helloWorld: CliPlugin get() = "Hello World" { meta( - namedFunction(this, { name == "helloWorld" }) { c -> // <-- namedFunction(...) {...} + namedFunction(this, { element.name == "helloWorld" }) { (c, _) -> // <-- namedFunction(...) {...} Transform.replace( replacing = c, newDeclaration = """|fun helloWorld(): Unit = | println("Hello ΛRROW Meta!") - |""".function + |""".function(descriptor).syntheticScope ) } )