scalaz.typelevel

GenericList

Related Docs: object GenericList | package typelevel

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.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.e.

    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 scalaz.typelevel.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: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Prepends a value to this list.

  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. final def applyP[N[X] >: M[X], R](f: Function[R])(implicit arg0: Applicative[N]): N[R]

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

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. 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.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. 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.

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. 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.

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  21. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped