compiler-plugin / arrow.meta.quotes.expression / LambdaExpression
class LambdaExpression :
Scope
<KtLambdaExpression>
lambdaExpression(“””$(params)
”””, “”“$bodyExpression”””)
A template destructuring Scope for a KtLambdaExpression.
import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.lambdaExpression
val Meta.reformatFor: CliPlugin
get() =
"ReformatLambda" {
meta(
lambdaExpression(this, { true }) { e ->
Transform.replace(
replacing = e,
newDeclaration = lambdaExpression("""$`(params)`""", """$bodyExpression""")
)
}
)
}
<init> | lambdaExpression(“””$(params) ”””, “”“$bodyExpression”””)LambdaExpression(value: KtLambdaExpression, functionLiteral: FunctionLiteral = FunctionLiteral(value.functionLiteral), (params): ScopedList <KtParameter> = ScopedList(value = value.valueParameters), bodyExpression: BlockExpression ? = BlockExpression(value.bodyExpression)) |
(params) | val (params): ScopedList <KtParameter> |
bodyExpression | val bodyExpression: BlockExpression ? |
functionLiteral | val functionLiteral: FunctionLiteral |
value | val value: KtLambdaExpression |
identity | fun ElementScope .identity(): LambdaExpression |
map | fun <K : KtElement> Scope <K>.map(f: (K) -> K): Scope <K> |
orEmpty | fun <K : KtElement> Scope <K>?.orEmpty(): Scope <K> |
Do you like Arrow?
✖