Trait/Object

scalaz.typelevel

GenericList

Related Docs: object GenericList | package typelevel

Permalink

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
Visibility
  1. Public
  2. All

Type Members

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

    Permalink
  2. abstract type Down <: GenericList[Id.Id]

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

    Permalink
  4. abstract type Function[R]

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

    Permalink

Abstract Value Members

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

    Permalink

    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]

    Permalink

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

  3. abstract def down: Down

    Permalink

    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]

    Permalink

    Folds this list using a scalaz.typelevel.HFold.

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

    Permalink

    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

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

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

    Permalink

    Prepends a value to this list.

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

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

    Permalink

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

  6. final def asInstanceOf[T0]: T0

    Permalink
    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]

    Permalink

    Accesses an element at a specific index.

  8. def clone(): AnyRef

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

    Permalink

    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

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

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

    Permalink
    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]

    Permalink

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped