org.specs2.foldm

FoldM

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
Learn more about member selection
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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. implicit def FoldComonad[T]: Comonad[[A]FoldM[T, [+X]X, A]]

    Comonad instance for Fold

  7. 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)

  8. 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

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

    Cobind instance

  10. 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

  11. 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)

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

    Natural transformation from Id to IO

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

    Natural transformation from a List to an Iterator

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

    monoid to append sinks effects

  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def clone(): AnyRef

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. 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

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

    returns

    a fold from a Monoid

  22. 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

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

    returns

    a fold from a Reducer

  24. 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

  25. 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

  26. 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

  27. 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

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

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

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

    identity fold for a MonadPlus monad

  31. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

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

    Definition Classes
    AnyRef
  36. def toString(): String

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

    sink doing nothing

  38. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped