scala.meta.contrib.implicits.ExtractExtensions.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalameta_native0.5_2.13 Show documentation
Show all versions of scalameta_native0.5_2.13 Show documentation
Scalameta umbrella module that includes all public APIs
The newest version!
package scala.meta.contrib.implicits
import scala.meta._
import scala.meta.contrib._
trait ExtractExtensions {
type StatExtractor[A] = Extract[A, Stat]
type ModExtractor[A] = Extract[A, Mod]
implicit class XtensionExtractors[A](a: A) {
def extract[B](implicit ev: Extract[A, B]): List[B] = ev.extract(a)
def hasMod(mod: Mod)(implicit ev: Extract[A, Mod]): Boolean = ev.extract(a)
.exists(_.isEqual(mod))
}
}
object ExtractExtensions extends ExtractExtensions
© 2015 - 2025 Weber Informatics LLC | Privacy Policy