Object/Trait

org.specs2.foldm

FoldM

Related Docs: trait FoldM | package foldm

Permalink

object FoldM

Typeclass instances and creation methods for folds

Linear Supertypes
AnyRef, Any
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]

    Permalink

    alias for a non-effectful Fold

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

    Permalink

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

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

    Permalink

    alias for a Fold sinking its last value

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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. implicit def FoldComonad[T]: Comonad[[A]FoldM[T, [+X]X, A]]

    Permalink

    Comonad instance for Fold

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

    Permalink

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

    Permalink

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

    Permalink

    Cobind instance

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

    Permalink

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

    Permalink

    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]

    Permalink

    Natural transformation from Id to IO

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

    Permalink

    Natural transformation from a List to an Iterator

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

    Permalink

    monoid to append sinks effects

  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

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

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

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

    Permalink

    returns

    a fold from arguments of a fold left

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

    Permalink

    returns

    a fold from a Monoid

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

    Permalink

    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 }

    Permalink

    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 }

    Permalink

    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]) }

    Permalink

    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]) }

    Permalink

    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 */ }

    Permalink

    returns

    a fold from running a State object

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  28. def idM[M[_], A](implicit arg0: MonadPlus[M]): FoldM[A, M, A] { type S = M[A] }

    Permalink

    identity fold for a MonadPlus monad

  29. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  35. def unitSink[T, M[_]](implicit arg0: Monad[M]): FoldM[T, M, Unit] { type S = Unit }

    Permalink

    sink doing nothing

  36. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped