All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.meta.contrib.implicits.ExtractExtensions.scala Maven / Gradle / Ivy

There is a newer version: 4.11.2
Show 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