IList

sealed abstract
class IList[A] extends Product with Serializable

Safe, invariant alternative to stdlib List. Most methods on List have a sensible equivalent here, either on the IList interface itself or via typeclass instances (which are the same as those defined for stdlib List). All methods are total and stack-safe.

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
class ICons[A]
class INil[A]

Value members

Concrete methods

def ++(as: IList[A]): IList[A]

alias for concat

alias for concat

def ++:(as: IList[A]): IList[A]

alias for prepend

alias for prepend

def +:(a: A): IList[A]
def /:[B](b: B)(f: (B, A) => B): B

alias for foldLeft

alias for foldLeft

def :+(a: A): IList[A]
def ::(a: A): IList[A]
def :::(as: IList[A]): IList[A]
def :\[B](b: B)(f: (A, B) => B): B

alias for foldRight

alias for foldRight

final
def <^>[B](f: OneAnd[IList, A] => B)(implicit B: Monoid[B]): B

Returns f applied to contents if non-empty, otherwise the zero of B.

Returns f applied to contents if non-empty, otherwise the zero of B.

def collect[B](pf: PartialFunction[A, B]): IList[B]
def collectFirst[B](pf: PartialFunction[A, B]): Maybe[B]
def concat(as: IList[A]): IList[A]
def containsSlice(as: IList[A])(implicit ev: Equal[A]): Boolean
def count(f: A => Boolean): Int
def distinct(implicit A: Order[A]): IList[A]
def drop(n: Int): IList[A]
def dropRight(n: Int): IList[A]
def dropRightWhile(f: A => Boolean): IList[A]
def dropWhile(f: A => Boolean): IList[A]
def endsWith(as: IList[A])(implicit ev: Equal[A]): Boolean
def filter(f: A => Boolean): IList[A]
def filterM[F[_]](f: A => F[Boolean])(implicit F: Applicative[F]): F[IList[A]]
def filterNot(f: A => Boolean): IList[A]
def find(f: A => Boolean): Maybe[A]
def flatMap[B](f: A => IList[B]): IList[B]
def flatten[B](implicit ev: Liskov[A, IList[B]]): IList[B]
def foldLeft[B](b: B)(f: (B, A) => B): B
def foldRight[B](b: B)(f: (A, B) => B): B
def groupBy[K](f: A => K)(implicit ev: Order[K]): K ==>> NonEmptyList[A]
def groupBy1[K](f: A => K)(implicit ev: Order[K]): K ==>> OneAnd[IList, A]
def headOption: Option[A]
def indexOf(a: A)(implicit ev: Equal[A]): Option[Int]
def indexOfSlice(slice: IList[A])(implicit ev: Equal[A]): Option[Int]
def indexWhere(f: A => Boolean): Option[Int]
def inits: IList[IList[A]]
def interleave(that: IList[A]): IList[A]
def intersperse(a: A): IList[A]
def isEmpty: Boolean
def lastIndexOf(a: A)(implicit ev: Equal[A]): Option[Int]
def lastIndexOfSlice(as: IList[A])(implicit ev: Equal[A]): Option[Int]
def lastIndexWhere(f: A => Boolean): Option[Int]
@tailrec
final
def lastOption: Option[A]
def length: Int
def map[B](f: A => B): IList[B]
def mapAccumLeft[B, C](c: C)(f: (C, A) => (C, B)): (C, IList[B])

All of the Bs, in order, and the final C acquired by a stateful left fold over as.

All of the Bs, in order, and the final C acquired by a stateful left fold over as.

final
def mapAccumRight[B, C](c: C)(f: (C, A) => (C, B)): (C, IList[B])

All of the Bs, in order as-wise, and the final C acquired by a stateful right fold over as.

All of the Bs, in order as-wise, and the final C acquired by a stateful right fold over as.

def nonEmpty: Boolean
def padTo(n: Int, a: A): IList[A]
def partition(f: A => Boolean): (IList[A], IList[A])
def patch(from: Int, patch: IList[A], replaced: Int): IList[A]
def prefixLength(f: A => Boolean): Int
def prepend(as: IList[A]): IList[A]
def reduceLeftOption(f: (A, A) => A): Option[A]
def reduceRightOption(f: (A, A) => A): Option[A]
def reverse: IList[A]
def reverseMap[B](f: A => B): IList[B]
def reverse_:::(as: IList[A]): IList[A]
def scanLeft[B](z: B)(f: (B, A) => B): IList[B]
def scanRight[B](z: B)(f: (A, B) => B): IList[B]
def slice(from: Int, until: Int): IList[A]
def sortBy[B](f: A => B)(implicit B: Order[B]): IList[A]
def sorted(implicit ev: Order[A]): IList[A]
def span(f: A => Boolean): (IList[A], IList[A])
def splitAt(n: Int): (IList[A], IList[A])
def startsWith(as: IList[A])(implicit ev: Equal[A]): Boolean
def tails: IList[IList[A]]
def take(n: Int): IList[A]
def takeRight(n: Int): IList[A]
def takeRightWhile(f: A => Boolean): IList[A]
def takeWhile(f: A => Boolean): IList[A]
def toList: List[A]
def toMap[K, V](implicit ev0: Liskov[A, (K, V)], ev1: Order[K]): K ==>> V
def toStream: Stream[A]
override
def toString: String
Definition Classes
Any
def toVector: Vector[A]
def traverseDisjunction[E, B](f: A => E \/ B): E \/ IList[B]

Referentially transparent replacement for traverse, specialised to disjunction.

Referentially transparent replacement for traverse, specialised to disjunction.

def uncons[B](n: => B, c: (A, IList[A]) => B): B
def unzip[B, C](implicit ev: Liskov[A, (B, C)]): (IList[B], IList[C])
def updated(index: Int, a: A): IList[A]

Unlike stdlib's version, this is total and simply ignores indices that are out of range

Unlike stdlib's version, this is total and simply ignores indices that are out of range

def widen[B](implicit ev: Liskov[A, B]): IList[B]
def zip[B](b: => IList[B]): IList[(A, B)]
def zipWithIndex: IList[(A, Int)]

Inherited methods

def canEqual(that: Any): Boolean
Inherited from
Equals
def productArity: Int
Inherited from
Product
def productElement(n: Int): Any
Inherited from
Product
def productElementName(n: Int): String
Inherited from
Product
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def productPrefix: String
Inherited from
Product