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

harness.core.SeqOps.scala Maven / Gradle / Ivy

The newest version!
package harness.core

extension [A](self: List[A]) {

  def intersperse(value: A): List[A] = self match
    case h :: t => h :: t.flatMap { v => value :: v :: Nil }
    case Nil    => Nil

  def interject(value: A): List[A] =
    value :: self.flatMap { v => v :: value :: Nil }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy