compiler-plugin / arrow.meta.quotes.element.whencondition / WhenCondition

WhenCondition

class WhenCondition : Scope<KtWhenCondition>

condition.whenCondition

A template destructuring Scope for a KtWhenCondition.

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.whenCondition

val Meta.reformatWhenCondition: CliPlugin
 get() =
  "ReformatWhenCondition" {
   meta(
    whenCondition({ true }) { c ->
     Transform.replace(
      replacing = c,
      newDeclaration = condition.whenCondition
     )
    }
   )
  }

Constructors

<init> condition.whenConditionWhenCondition(value: KtWhenCondition?, condition: String = value?.text ?: "")

Properties

condition val condition: String
value val value: KtWhenCondition?

Functions

identity fun ElementScope.identity(): WhenCondition

Extension Functions

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?

Arrow Org
<