gapt.formats.tip.util.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gapt_3 Show documentation
Show all versions of gapt_3 Show documentation
General Architecture for Proof Theory
The newest version!
package gapt.formats.tip
package object util {
object find {
def apply[T](
elements: Seq[T],
p: (T) => Boolean
): Option[(Seq[T], T, Seq[T])] = {
val index = elements.indexWhere(p)
if (index == -1) {
None
} else {
Some((
elements.take(index),
elements(index),
elements.drop(index + 1)
))
}
}
}
}