harness.core.SeqOps.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of harness-core_sjs1_3 Show documentation
Show all versions of harness-core_sjs1_3 Show documentation
Miscellaneous libraries/utilities for Scala.
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