Package

matryoshka

Permalink

package matryoshka

Generalized folds, unfolds, and refolds.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. matryoshka
  2. FreeInstances
  3. CofreeInstances
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type Algebra[F[_], A] = (F[scalaz.Scalaz.Id[A]]) ⇒ scalaz.Scalaz.Id[A]

    Permalink
  2. type AlgebraM[M[_], F[_], A] = (F[scalaz.Scalaz.Id[A]]) ⇒ M[A]

    Permalink
  3. sealed class AlgebraOps[F[_], A] extends AnyRef

    Permalink
  4. final class AttributeCoelgotMPartiallyApplied[M[_]] extends AnyRef

    Permalink
  5. type Coalgebra[F[_], A] = (A) ⇒ scalaz.Scalaz.Id[F[scalaz.Scalaz.Id[A]]]

    Permalink
  6. type CoalgebraM[M[_], F[_], A] = (A) ⇒ M[F[scalaz.Scalaz.Id[A]]]

    Permalink
  7. sealed class CoalgebraOps[F[_], A] extends AnyRef

    Permalink
  8. final class CoelgotMPartiallyApplied[M[_]] extends AnyRef

    Permalink
  9. final class CofParaMPartiallyApplied[M[_]] extends AnyRef

    Permalink
  10. trait CofreeInstances extends AnyRef

    Permalink
  11. trait Corecursive[T[_[_]]] extends Serializable

    Permalink

    Unfolds for corecursive data types.

  12. sealed class CorecursiveOps[T[_[_]], F[_]] extends AnyRef

    Permalink
  13. type DistributiveLaw[F[_], G[_]] = NaturalTransformation[[α]F[G[α]], [α]G[F[α]]]

    Permalink

    A NaturalTransformation that sequences two types

  14. type ElgotAlgebra[F[_], A, B] = (A, F[B]) ⇒ scalaz.Scalaz.Id[B]

    Permalink
  15. type ElgotAlgebraM[M[_], F[_], A, B] = (A, F[B]) ⇒ M[B]

    Permalink
  16. type ElgotCoalgebra[F[_], A, B] = (A) ⇒ scalaz.Scalaz.Id[\/[B, F[A]]]

    Permalink
  17. type ElgotCoalgebraM[M[_], F[_], A, B] = (A) ⇒ M[\/[B, F[A]]]

    Permalink
  18. final case class EnvT[E, W[_], A](run: (E, W[A])) extends Product with Serializable

    Permalink

    This is the transformer for the (,) comonad.

  19. trait EnvTFunctions extends AnyRef

    Permalink
  20. sealed abstract class EnvTInstances extends EnvTInstances0

    Permalink
  21. sealed abstract class EnvTInstances0 extends AnyRef

    Permalink
  22. final case class Fix[F[_]](unFix: F[Fix[F]]) extends Product with Serializable

    Permalink
  23. trait FreeInstances extends AnyRef

    Permalink
  24. trait FunctorT[T[_[_]]] extends Serializable

    Permalink

    The operations here are very similar to those in Recursive and Corecursive.

    The operations here are very similar to those in Recursive and Corecursive. The usual names (cata, ana, etc.) are prefixed with trans and behave generally the same, except 1. the A of the [un]fold is restricted to T[G], but 2. the [co]algebra shape is like F[A] => G[A] rather than F[A] => A.

    In exchange, the [un]folds are available to more types (EG, folds available to Free and unfolds available to Cofree).

    There are two additional operations – transCataT and transAnaT. The distinction between these and transCata/transAna is that this allows the algebra to return the context (the outer T) to be used, whereas transCata always uses the original context of the argument to f.

    This is noticable when T is Cofree. In this function, the result may have any head the algebra desires, whereas in transCata, it can only have the head of the argument to f.

    Docs for operations, since they seem to break scaladoc if put in the right place:

    * map – very roughly like Uniplate’s descend * transCataT – akin to Uniplate’s transform * transAnaT – akin to Uniplate’s topDownTransform * transCata – akin to Fixplate’s restructure

  25. type GAlgebra[W[_], F[_], A] = (F[W[A]]) ⇒ scalaz.Scalaz.Id[A]

    Permalink
  26. type GAlgebraM[W[_], M[_], F[_], A] = (F[W[A]]) ⇒ M[A]

    Permalink
  27. type GCoalgebra[N[_], F[_], A] = (A) ⇒ scalaz.Scalaz.Id[F[N[A]]]

    Permalink
  28. type GCoalgebraM[N[_], M[_], F[_], A] = (A) ⇒ M[F[N[A]]]

    Permalink
  29. sealed trait Hole extends AnyRef

    Permalink
  30. sealed class IdOps[A] extends AnyRef

    Permalink
  31. final case class Mu[F[_]](unMu: ~>[[A](F[A]) ⇒ A, scalaz.Scalaz.Id]) extends Product with Serializable

    Permalink
  32. final case class Nu[F[_]](unNu: ~>[scalaz.Scalaz.Id, F], a: scalaz.Scalaz.Id[_]) extends Product with Serializable

    Permalink
  33. trait Recursive[T[_[_]]] extends Serializable

    Permalink

    Folds for recursive data types.

  34. trait TraverseT[T[_[_]]] extends FunctorT[T] with Serializable

    Permalink

Value Members

  1. implicit def AlgebraZip[F[_]](implicit arg0: Functor[F]): Zip[[γ](F[scalaz.Scalaz.Id[γ]]) ⇒ γ]

    Permalink
  2. object Corecursive extends Serializable

    Permalink
  3. implicit def ElgotAlgebraMZip[M[_], F[_], C](implicit arg0: Applicative[M], arg1: Functor[F]): Zip[[δ](C, F[δ]) ⇒ M[δ]]

    Permalink
  4. implicit def ElgotAlgebraZip[F[_], C](implicit arg0: Functor[F]): Zip[[δ](C, F[δ]) ⇒ scalaz.Scalaz.Id[δ]]

    Permalink
  5. object EnvT extends EnvTInstances with EnvTFunctions with Serializable

    Permalink
  6. object Fix extends Serializable

    Permalink
  7. implicit def FreeCorecursive[A]: Corecursive[[α[_$3]]Free[α, A]]

    Permalink
    Definition Classes
    FreeInstances
  8. implicit def FreeTraverseT[A]: TraverseT[[α[_$1]]Free[α, A]]

    Permalink
    Definition Classes
    FreeInstances
  9. object FunctorT extends Serializable

    Permalink
  10. implicit def GAlgebraZip[W[_], F[_]](implicit arg0: Functor[W], arg1: Functor[F]): Zip[[γ](F[W[γ]]) ⇒ γ]

    Permalink
  11. val Hole: Hole

    Permalink
  12. object Mu extends Serializable

    Permalink
  13. object Nu extends Serializable

    Permalink
  14. object Recursive extends Serializable

    Permalink
  15. implicit def ToAlgebraOps[F[_], A](a: Algebra[F, A]): AlgebraOps[F, A]

    Permalink
  16. implicit def ToCoalgebraOps[F[_], A](a: Coalgebra[F, A]): CoalgebraOps[F, A]

    Permalink
  17. implicit def ToCorecursiveOps[T[_[_]], F[_]](f: F[T[F]])(implicit arg0: Corecursive[T]): CorecursiveOps[T, F]

    Permalink
  18. implicit def ToIdOps[A](a: A): IdOps[A]

    Permalink
  19. object TraverseT extends Serializable

    Permalink
  20. def attrK[F[_], A](k: A)(implicit arg0: Functor[F]): (F[Cofree[F, A]]) ⇒ scalaz.Scalaz.Id[Cofree[F, A]]

    Permalink
  21. def attrSelf[T[_[_]], F[_]](implicit arg0: Corecursive[T], arg1: Functor[F]): (F[Cofree[F, T[F]]]) ⇒ scalaz.Scalaz.Id[Cofree[F, T[F]]]

    Permalink
  22. def attribute[F[_], A](f: (F[A]) ⇒ A)(implicit arg0: Functor[F]): (F[Cofree[F, A]]) ⇒ scalaz.Scalaz.Id[Cofree[F, A]]

    Permalink
  23. def attributeCoelgotM[M[_]]: AttributeCoelgotMPartiallyApplied[M]

    Permalink
  24. def attributeM[F[_], M[_], A](f: (F[A]) ⇒ M[A])(implicit arg0: Functor[F], arg1: Functor[M]): (F[Cofree[F, A]]) ⇒ M[Cofree[F, A]]

    Permalink

    Turns any F-algebra, into an identical one that attributes the tree with the results for each node.

  25. def attributePara[T[_[_]], F[_], A](f: (F[(T[F], A)]) ⇒ A)(implicit arg0: Corecursive[T], arg1: Functor[F]): (F[Cofree[F, A]]) ⇒ Cofree[F, A]

    Permalink

    NB: Since Cofree carries the functor, the resulting algebra is a cata, not a para.

  26. def builder[F[_], A, B](fa: F[A], children: List[B])(implicit arg0: Traverse[F]): F[B]

    Permalink
  27. def chrono[F[_], A, B](a: A)(g: (F[Cofree[F, B]]) ⇒ B, f: (A) ⇒ F[Free[F, A]])(implicit arg0: Functor[F]): B

    Permalink

    Similar to a hylomorphism, this composes a futumorphism and a histomorphism.

  28. def coelgot[F[_], A, B](a: A)(φ: (A, F[B]) ⇒ B, ψ: (A) ⇒ F[A])(implicit arg0: Functor[F]): B

    Permalink
  29. def coelgotM[M[_]]: CoelgotMPartiallyApplied[M]

    Permalink
  30. def cofCataM[S[_], M[_], A, B](t: Cofree[S, A])(f: (A, S[B]) ⇒ M[B])(implicit arg0: Traverse[S], arg1: Monad[M]): M[B]

    Permalink
  31. def cofParaM[M[_]]: CofParaMPartiallyApplied[M]

    Permalink
  32. object cofree extends CofreeInstances

    Permalink
  33. implicit def cofreeRecursive[A]: Recursive[[α[_$1]]Cofree[α, A]]

    Permalink
    Definition Classes
    CofreeInstances
  34. implicit def cofreeShow[F[_], A](implicit arg0: Show[A], F: ~>[Show, [α]Show[F[α]]]): Show[Cofree[F, A]]

    Permalink
    Definition Classes
    CofreeInstances
  35. implicit def cofreeTraverseT[A]: TraverseT[[α[_$3]]Cofree[α, A]]

    Permalink
    Definition Classes
    CofreeInstances
  36. def colambek[T[_[_]], F[_]](ft: F[T[F]])(implicit arg0: Corecursive[T], arg1: Recursive[T], arg2: Functor[F]): T[F]

    Permalink
  37. def count[T[_[_]], F[_]](form: T[F])(implicit arg0: Recursive[T], arg1: Functor[F], arg2: Foldable[F]): (F[(T[F], Int)]) ⇒ Int

    Permalink

    Count the instinces of form in the structure.

  38. def distAna[F[_]]: DistributiveLaw[scalaz.Scalaz.Id, F]

    Permalink
  39. def distCata[F[_]]: DistributiveLaw[F, scalaz.Scalaz.Id]

    Permalink
  40. def distFutu[F[_]](implicit arg0: Functor[F]): DistributiveLaw[[β]Free[F, β], F]

    Permalink
  41. def distGFutu[H[_], F[_]](k: DistributiveLaw[H, F])(implicit H: Functor[H], F: Functor[F]): DistributiveLaw[[β]Free[H, β], F]

    Permalink
  42. def distGHisto[F[_], H[_]](k: DistributiveLaw[F, H])(implicit F: Functor[F], H: Functor[H]): DistributiveLaw[F, [β]Cofree[H, β]]

    Permalink
  43. def distHisto[F[_]](implicit arg0: Functor[F]): DistributiveLaw[F, [β]Cofree[F, β]]

    Permalink
  44. def distPara[T[_[_]], F[_]](implicit arg0: Functor[F], T: Corecursive[T]): DistributiveLaw[F, [β](T[F], β)]

    Permalink
  45. def distParaT[T[_[_]], F[_], W[_]](t: DistributiveLaw[F, W])(implicit arg0: Functor[F], arg1: Comonad[W], T: Corecursive[T]): DistributiveLaw[F, [γ]EnvT[T[F], W, γ]]

    Permalink
  46. def distZygo[F[_], B](g: (F[B]) ⇒ B)(implicit arg0: Functor[F]): DistributiveLaw[F, [β](B, β)]

    Permalink
  47. def distZygoT[F[_], W[_], B](g: (F[B]) ⇒ B, k: DistributiveLaw[F, W])(implicit arg0: Comonad[W], F: Functor[F]): DistributiveLaw[F, [γ]EnvT[B, W, γ]]

    Permalink
  48. def elgot[F[_], A, B](a: A)(φ: (F[B]) ⇒ B, ψ: (A) ⇒ \/[B, F[A]])(implicit arg0: Functor[F]): B

    Permalink
  49. object free extends FreeInstances

    Permalink
  50. def ghylo[F[_], W[_], M[_], A, B](a: A)(w: DistributiveLaw[F, W], m: DistributiveLaw[M, F], f: (F[W[B]]) ⇒ B, g: (A) ⇒ F[M[A]])(implicit arg0: Functor[F], arg1: Comonad[W], M: Monad[M]): B

    Permalink

    A generalized version of a hylomorphism that composes any coalgebra and algebra.

  51. def holes[F[_], A](fa: F[A])(implicit arg0: Traverse[F]): F[(A, (A) ⇒ F[A])]

    Permalink
  52. def holesList[F[_], A](fa: F[A])(implicit arg0: Traverse[F]): List[(A, (A) ⇒ F[A])]

    Permalink
  53. def hylo[F[_], A, B](a: A)(f: (F[B]) ⇒ B, g: (A) ⇒ F[A])(implicit arg0: Functor[F]): B

    Permalink

    Composition of an anamorphism and a catamorphism that avoids building the intermediate recursive data structure.

  54. def hyloM[M[_], F[_], A, B](a: A)(f: (F[B]) ⇒ M[B], g: (A) ⇒ M[F[A]])(implicit arg0: Monad[M], arg1: Traverse[F]): M[B]

    Permalink

    A Kleisli hylomorphism.

  55. def lambek[T[_[_]], F[_]](tf: T[F])(implicit arg0: Corecursive[T], arg1: Recursive[T], arg2: Functor[F]): F[T[F]]

    Permalink
  56. def once[A](f: (A) ⇒ Option[A]): (A) ⇒ A

    Permalink

    Converts a failable fold into a non-failable, by simply returning the argument upon failure.

  57. def project[F[_], A](index: Int, fa: F[A])(implicit arg0: Foldable[F]): Option[A]

    Permalink
  58. def repeatedly[A](f: (A) ⇒ Option[A]): (A) ⇒ A

    Permalink

    Repeatedly applies the function to the result as long as it returns Some.

    Repeatedly applies the function to the result as long as it returns Some. Finally returns the last non-None value (which may be the initial input).

Inherited from FreeInstances

Inherited from CofreeInstances

Inherited from AnyRef

Inherited from Any

Ungrouped