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
- Alphabetic
- By Inheritance
- GenericList
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- abstract type Appended[N[X] >: M[X], L <: GenericList[N]] <: GenericList[N[X]]
- abstract type Down <: GenericList[Id.Id]
- abstract type Folded[N[X] >: M[X], U, F <: HFold[N, U]] <: U
- abstract type Function[R]
- abstract type Transformed[N[_]] <: GenericList[N[_]]
Abstract Value Members
-
abstract
def
append[N[X] >: M[X], L <: GenericList[N]](list: L): Appended[N, L]
Appends the given list to this list.
-
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.
-
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]
byId[M[A]]
. The resulting list contains exactly the same elements as the resulting list. -
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.
-
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 byN
.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
:^:[A, N[X] >: M[X]](elem: N[A]): GenericCons[N, A, GenericList.this.type]
Prepends a value to this list.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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 intoN
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )