IterableExtensions

final class IterableExtensions[A](val thisIter: Iterable[A]) extends AnyVal

Extension methods for Iterable[A].

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def fLast[B](ifEmpty: => B, fNonEmpty: A => B): B
def foldWithPrevious[B](initPrevious: A, initAcc: B)(f: (B, A, A) => B): B
def headOnly[B](ifEmpty: => B, fNonEmpty: A => B): B

This method and "fHead" removes the need for headOption in the majority of case. Use fHead when are interested in the tail value

This method and "fHead" removes the need for headOption in the majority of case. Use fHead when are interested in the tail value

def headOrElse(vEmpty: A): A
def headToStringElse(elseString: => String): String

If the collection is nonEmpty, return head of list convert to string or return the defualt string.

If the collection is nonEmpty, return head of list convert to string or return the defualt string.

def iFlatMap[B, BB <: ArrImut[B]](f: (A, Int) => BB, count: Int)(implicit build: ArrTBuilder[B, BB]): BB

flatMaps over a traversable (collection / sequence) with a counter

flatMaps over a traversable (collection / sequence) with a counter

def iForall(f: (A, Int) => Boolean): Boolean
def iForeach(f: (A, Int) => Unit, initialIndex: Int): Unit

foreach loop with index. The startIndex parameter is placed 2nd to allow it to have a default value of zero.

foreach loop with index. The startIndex parameter is placed 2nd to allow it to have a default value of zero.

def iMap[B, BB <: ArrImut[B]](f: (A, Int) => B, count: Int)(implicit build: ArrTBuilder[B, BB]): BB

Maps over and

Maps over and

def ifEmpty[B](vEmpty: => B, vNonEmpty: => B): B
def ifHead(f: A => Boolean): Boolean

Checks condition against head. Returns false if the collection is empty.

Checks condition against head. Returns false if the collection is empty.

def iterHead[B](ifEmpty: => B, fNonEmpty: (A, Iterable[A]) => B): B
def mapArr[B, BB <: ArrImut[B]](f: A => B)(implicit ev: ArrTBuilder[B, BB]): BB

Maps to a ArrImut an immutable Array of B.

Maps to a ArrImut an immutable Array of B.

def sumBy(f: A => Int): Int
def toImut[AA <: ArrImut[A]](implicit bu: ArrTBuilder[A, AA]): AA

Converts to ArrImut of A. Most commonly a Refs. Prefer the mapArr method where appropriate which combines the converson with a map operation.

Converts to ArrImut of A. Most commonly a Refs. Prefer the mapArr method where appropriate which combines the converson with a map operation.

def toStrFold2[B](secondAcc: B)(f: (B, A) => (String, B)): String
def toStrsCommaFold(fToStr: A => String): String
def toStrsCommaNoSpaceFold(fToStr: A => String): String
def toStrsCommaParenth(fToStr: A => String): String
def toStrsFold(seperator: String, f: A => String): String
def toStrsSemiFold(fToStr: A => String): String
def toStrsSemiParenth(fToStr: A => String): String

Concrete fields

val thisIter: Iterable[A]