scalaz.typelevel

GenericList

sealed trait GenericList[+M[_]] extends AnyRef

A list which preserves the precise types of all elements. It can be seen as a generalized tuple of arbitrary arity.

This structure allows to store values of different types together and supports some basic operations like appending, folding or mapping via a scalaz.NaturalTransformation. It also serves as a replacement for scalaz.syntax.ApplicativeBuilder.

All elements have to share a common type constructor, e.g. scala.List or scala.Option. This makes easy use with scalaz.Applicative possible. If the types of the elements are not in appropriate shape, use scalaz.Id.

Because this trait is covariant in M, most methods have an additional type parameter N which is usually inferred to be equal to M. However, it is still possible to prepend a value of type Option[A] to a list with the type constructor Some.

M

The common type constructor of all elements.

Source
GenericList.scala
See also

scalaz.typelevel.HList

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GenericList
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Appended[N[X] >: M[X], L <: GenericList[N]] <: GenericList[N[X]]

  2. abstract type Down <: GenericList[Id]

  3. abstract type Folded[N[X] >: M[X], U, F <: HFold[N, U]] <: U

  4. abstract type Function[R]

  5. abstract type Transformed[N[_]] <: GenericList[N[_]]

Abstract Value Members

  1. abstract def append[N[X] >: M[X], L <: GenericList[N]](list: L): Appended[N, L]

    Appends the given list to this list.

  2. abstract def apply[N[X] >: M[X], R](f: N[Function[R]])(implicit arg0: Apply[N]): N[R]

    Successively applies a (curried) function to the elements of this list using the specified scalaz.Apply instance.

  3. abstract def down: Down

    Converts this list to a scalaz.typelevel.HList, i.

    Converts this list to a scalaz.typelevel.HList, i.e. replaces every type M[A] by Id[M[A]]. The resulting list contains exactly the same elements as the resulting list.

  4. abstract def fold[N[X] >: M[X], U, F <: HFold[N, U]](f: F): Folded[N, U, F]

    Folds this list using a HFold.

  5. abstract def transform[N[_]](trans: ~>[M, N]): Transformed[N]

    Applies a scalaz.NaturalTransformation to all elements, preserving the overall structure of the list.

    Applies a scalaz.NaturalTransformation to all elements, preserving the overall structure of the list. The result list has the same element types except that every occurence of the original common type constructor M is replaced by N.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def :^:[A, N[X] >: M[X]](elem: N[A]): GenericCons[N, A, GenericList.this.type]

    Prepends a value to this list.

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. final def applyP[N[X] >: M[X], R](f: Function[R])(implicit arg0: Apply[N], arg1: Pointed[N]): N[R]

    Version of apply which takes the bare function and wraps it into N.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. final def at[N[X] >: M[X], I <: Nat, E](index: I)(implicit ev: IndexProof[N, E, I, GenericList.this.type]): N[E]

    Accesses an element at a specific index.

  10. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def coerce[N[X] >: M[X]]: Transformed[N]

    Upcasts the type constructor in this list.

    Upcasts the type constructor in this list. This operation is safe.

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. final def foldU[N[X] >: M[X], U](f: HFold[N, U]): Folded[N, U, f.type]

    Dependently typed version of fold which improves type inference in some circumstances.

  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any