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

codacy.events.internal.PathHolders.scala Maven / Gradle / Ivy

The newest version!
package codacy.events.internal

import codacy.events.{Event, PathHolder}
import shapeless.{:+:, lazily, CNil, Coproduct, Lazy}

object PathHolders {
  implicit def caseCNil: PathHolders[CNil] = Impl(Set.empty)

  implicit def caseCCons[H <: Event, T <: Coproduct](implicit
      h: Lazy[PathHolder[H]],
      t: Lazy[PathHolders[T]]
  ): PathHolders[H :+: T] = {
    Impl(lazily[PathHolders[T]].paths + lazily[PathHolder[H]].path)
  }

  private case class Impl[T](paths: Set[String]) extends AnyVal with PathHolders[T]
}

sealed trait PathHolders[C] extends Any {
  def paths: Set[String]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy