package typelevel
Type-level data structures in Scalaz.
This package contains:
- heterogeneous lists
- type-level natural numbers
- type-safe port of Java's printf
In general, including scalaz.typelevel._
should be enough.
- Source
- package.scala
- Alphabetic
- By Inheritance
- typelevel
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- sealed trait Format[T, R] extends AnyRef
- trait Formatter[Params <: HList, R] extends (Params) ⇒ R
- trait Formatters extends AnyRef
-
trait
Func[F[_], TC[F[_]] <: Functor[F[_]], A, B] extends AnyRef
Represents a function
A => F[B]
where[F: TC]
.Represents a function
A => F[B]
where[F: TC]
.Contributed by Eugene Yokota.
- trait FuncFunctions extends AnyRef
- trait FuncInstances extends FuncInstances1
- trait FuncInstances1 extends FuncInstances2
- trait FuncInstances2 extends FuncInstances3
- trait FuncInstances3 extends AnyRef
-
case class
GenericCons[M[_], H, +T <: GenericList[M]](head: M[H], tail: T) extends GenericList[M] with Product with Serializable
- See also
-
sealed
trait
GenericList[+M[_]] extends AnyRef
A list which preserves the precise types of all elements.
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 parameterN
which is usually inferred to be equal toM
. However, it is still possible to prepend a value of typeOption[A]
to a list with the type constructorSome
.- M
The common type constructor of all elements.
- See also
-
case class
GenericNil[M[_]]() extends GenericList[M] with Product with Serializable
- See also
-
type
HCons[H, T <: HList] = GenericCons[Id.Id, H, T]
- Note
::
as type and extractor is available in scalaz.syntax.typelevel.HLists
- case class HConsFunc[F[_], TC[F[_]] <: Functor[F[_]], A, B, +T <: HListFunc[TC, A, B]](head: Func[F, TC, A, B], tail: T) extends HListFunc[TC, A, B] with Product with Serializable
- trait HFold[M[_], U] extends AnyRef
-
type
HList = GenericList[Id.Id]
A scalaz.typelevel.GenericList with the type constructor scalaz.Id
-
trait
HListFunc[TC[X[_]] <: Functor[X[_]], A, B] extends AnyRef
Represents a function
A => T#Product[B]
where[L <: TCList]
.Represents a function
A => T#Product[B]
where[L <: TCList]
.Example:
import scalaz._, std.AllInstances._, typelevel._, Func._ val list = AppFuncU { (x: Int) => x + 1 } :: AppFuncU { (x: Int) => List(x + 5) } :: AppFunc.HNil list.traverse(List(1, 2, 3))
- type HNil = GenericNil[Id.Id]
- case class HNilFunc[TC[F[_]] <: Functor[F[_]], A, B](TC0: KTypeClass[TC]) extends HListFunc[TC, A, B] with Product with Serializable
-
trait
HStream[T[_ <: Nat]] extends AbstractHStream
An infinite sequence of elements with different types.
- type KCons[M[_], H, +T <: KList[M]] = GenericCons[M, H, T]
-
type
KList[M[_]] = GenericList[M]
Alias for scalaz.typelevel.KList
- type KNil[M[_]] = GenericNil[M]
-
trait
KTypeClass[C[_[_]]] extends AnyRef
A type class abstracting over the
product
andcompose
operations of type classes over types of kind* -> *
.A type class abstracting over the
product
andcompose
operations of type classes over types of kind* -> *
.It serves as a replacement for the various
Product*
classes in scalaz.Multiplication of instances is done via wrappers which are unpacked automatically if the implicits of scalaz.syntax.typelevel.TypeClasses are imported.
- trait NFold[U] extends AnyRef
- sealed trait Nat extends AnyRef
- trait Nats extends AnyRef
- class SimpleUnionFormat[D <: UnionTypes.Disj, R] extends UnionFormat[D, R]
- case class Succ[N <: Nat](predecessor: N) extends Nat with Product with Serializable
- sealed trait TCCons[M[_], T <: TCList] extends TCList
-
sealed
trait
TCList extends AnyRef
A structure storing a list of type constructors in the type, providing type conversions for composition and products.
A structure storing a list of type constructors in the type, providing type conversions for composition and products.
- Note
There are no values of this type.
- See also
scalaz.typelevel.TypeClass
- sealed trait TCNil extends TCList
- trait UnionFormat[D <: UnionTypes.Disj, R] extends Format[UnionTypes.Union[D], R]
-
type
UpperConstrained[T[_], U] = AnyRef { type Apply[X <: U] = T[X] }
Constraining a type constructor to a certain upper bound
Value Members
- val :^:: GenericCons.type
-
def
FNil[R](implicit arg0: Monoid[R]): Formatter[HNil, R]
The empty scalaz.typelevel.Formatter.
- lazy val HNil: HNil
- val KNil: _KNil.type
- implicit def mkIdOps[T <: HList](list: T): IdOps[T]
- object AppFunc
- object AppFuncU
- object ApplyFunc
- object ApplyFuncU
- object Format
- object Formatter extends Formatters
- object Func extends FuncFunctions with FuncInstances
- object FunctorFunc
- object FunctorFuncU
- object GenericList
- object HCons extends Serializable
- object HFold
- object HListFunc
- object HLists
- object HStream
- object KTypeClass
- object NFold
- object Nats extends Nats
- object Typelevel extends AllSyntaxes with Nats
- object Zero extends Nat with Product with Serializable
- object _KNil extends KNil[Nothing]