Packages

object FoldM

Typeclass instances and creation methods for folds

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FoldM
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Fold[T, U] = FoldM[T, scalaz.Id.Id, U]

    alias for a non-effectful Fold

  2. type FoldState[T, U] = FoldM[T, scalaz.Id.Id, U] { type S = U }

    alias for a non-effectful Fold where the state type is U

  3. type SinkM[T, M[_]] = FoldM[T, M, Unit]

    alias for a Fold sinking its last value

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit def FoldComonad[T]: Comonad[[A]FoldM[T, [X]X, A]]

    Comonad instance for Fold

  5. implicit def FoldMApply[T, M[_]](implicit arg0: Apply[M]): Apply[[A]FoldM[T, M, A]]

    Apply instance

    Apply instance

    This means that we can write:

    val mean: Fold[Int, Int] = (sum |@| count)(_ / _)

    An Apply instance is also a Functor instance so we can write:

    val meanTimes2 = mean.map(_ * 2)

  6. def FoldMCategory[M[_]](implicit arg0: MonadPlus[M]): Category[[A, B]FoldM[A, M, B]]

    A FoldM can be turned into a Category if M has a MonadPlus instance

  7. def FoldMCobind[T, M[_]](implicit arg0: Monad[M]): Cobind[[A]FoldM[T, M, A]]

    Cobind instance

  8. implicit def FoldMCompose[M[_]](implicit arg0: Monad[M]): Compose[[A, B]FoldM[A, M, B]]

    A FoldM can be turned into a Compose if M has a Monad instance

    A FoldM can be turned into a Compose if M has a Monad instance

    This allows us to write:

    val scans = sum compose list

  9. implicit def FoldMProfunctor[M[_]](implicit arg0: Functor[M]): Profunctor[[A, B]FoldM[A, M, B]]

    Profunctor instance

    Profunctor instance

    This is especially useful because we can "map" on the input element

    val doubleSum = fromMonoid[Double] // sum all elements val roundedDoubleSum = doubleSum.mapfst(_.round)

  10. implicit val IdIONaturalTransformation: ~>[scalaz.Id.Id, IO]

    Natural transformation from Id to IO

  11. implicit val ListIteratorNaturalTransformation: ~>[List, Iterator]

    Natural transformation from a List to an Iterator

  12. implicit def SinkMMonoid[T, M[_]](implicit arg0: Monad[M]): Monoid[SinkM[T, M]]

    monoid to append sinks effects

  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def fromFoldLeft[T, U](u: U)(f: (U, T) ⇒ U): Fold[T, U] { type S = U }

    returns

    a fold from arguments of a fold left

  19. def fromMonoid[M](implicit arg0: Monoid[M]): Fold[M, M] { type S = M }

    returns

    a fold from a Monoid

  20. def fromMonoidMap[T, M](f: (T) ⇒ M)(implicit arg0: Monoid[M]): Fold[T, M] { type S = M }

    returns

    a fold which uses a Monoid to accumulate elements

  21. def fromReducer[T, S](reducer: Reducer[T, S]): Fold[T, S] { type S = S }

    returns

    a fold from a Reducer

  22. def fromStart[T, M[_], S1](action: M[S1])(implicit arg0: Monad[M]): FoldM[T, M, S1] { type S = S1 }

    returns

    a fold with just a start action

  23. def fromStateEval[T, M[_], U, V](state: (T) ⇒ State[U, V])(init: U)(implicit arg0: Monad[M]): FoldM[T, M, Option[V]] { type S = (U, Option[V]) }

    returns

    a fold for the evaluation of a State object

  24. def fromStateExec[T, M[_], U, V](state: (T) ⇒ State[U, V])(init: U)(implicit arg0: Monad[M]): FoldM[T, M, U] { type S = (U, Option[V]) }

    returns

    a fold for the execution of a State object

  25. def fromStateRun[T, M[_], U, V](state: (T) ⇒ State[U, V])(init: U)(implicit arg0: Monad[M]): FoldM[T, M, (U, Option[V])] { ... /* 2 definitions in type refinement */ }

    returns

    a fold from running a State object

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  28. def idM[M[_], A](implicit arg0: MonadPlus[M]): FoldM[A, M, A] { type S = M[A] }

    identity fold for a MonadPlus monad

  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. def unitSink[T, M[_]](implicit arg0: Monad[M]): FoldM[T, M, Unit] { type S = Unit }

    sink doing nothing

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

Inherited from AnyRef

Inherited from Any

Ungrouped