Monad

org.specs2.fp.Monad
See theMonad companion object
trait Monad[F[_]] extends Applicative[F]

Inspired from the scalaz (https://github.com/scalaz/scalaz) project

Attributes

Companion
object
Graph
Supertypes
trait Applicative[F]
trait Functor[F]
class Object
trait Matchable
class Any
Known subtypes
object idMonad.type
object optionMonad.type
object name.type

Members list

Value members

Abstract methods

def bind[A, B](fa: F[A])(f: A => F[B]): F[B]

Concrete methods

def ap[A, B](fa: => F[A])(f: => F[A => B]): F[B]
def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]
def iterateUntil[A](f: F[A])(p: A => Boolean): F[A]

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Attributes

def iterateWhile[A](f: F[A])(p: A => Boolean): F[A]
def join[A](ffa: F[F[A]]): F[A]
override def map[A, B](fa: F[A])(f: A => B): F[B]

Attributes

Definition Classes
def tailrecM[A, B](a: A)(f: A => F[Either[A, B]]): F[B]

Inherited methods

def ap2[A, B, C](fa: => F[A], fb: => F[B])(f: F[(A, B) => C]): F[C]

Attributes

Inherited from:
Applicative
def ap3[A, B, C, D](fa: => F[A], fb: => F[B], fc: => F[C])(f: F[(A, B, C) => D]): F[D]

Attributes

Inherited from:
Applicative
def ap4[A, B, C, D, E](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D])(f: F[(A, B, C, D) => E]): F[E]

Attributes

Inherited from:
Applicative
def ap5[A, B, C, D, E, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E])(f: F[(A, B, C, D, E) => R]): F[R]

Attributes

Inherited from:
Applicative
def ap6[A, B, C, D, E, FF, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF])(f: F[(A, B, C, D, E, FF) => R]): F[R]

Attributes

Inherited from:
Applicative
def ap7[A, B, C, D, E, FF, G, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G])(f: F[(A, B, C, D, E, FF, G) => R]): F[R]

Attributes

Inherited from:
Applicative
def ap8[A, B, C, D, E, FF, G, H, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H])(f: F[(A, B, C, D, E, FF, G, H) => R]): F[R]

Attributes

Inherited from:
Applicative
def apply10[A, B, C, D, E, FF, G, H, I, J, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H], fi: => F[I], fj: => F[J])(f: (A, B, C, D, E, FF, G, H, I, J) => R): F[R]

Attributes

Inherited from:
Applicative
def apply11[A, B, C, D, E, FF, G, H, I, J, K, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H], fi: => F[I], fj: => F[J], fk: => F[K])(f: (A, B, C, D, E, FF, G, H, I, J, K) => R): F[R]

Attributes

Inherited from:
Applicative
def apply12[A, B, C, D, E, FF, G, H, I, J, K, L, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H], fi: => F[I], fj: => F[J], fk: => F[K], fl: => F[L])(f: (A, B, C, D, E, FF, G, H, I, J, K, L) => R): F[R]

Attributes

Inherited from:
Applicative
def apply2[A, B, C](fa: => F[A], fb: => F[B])(f: (A, B) => C): F[C]

Attributes

Inherited from:
Applicative
def apply3[A, B, C, D](fa: => F[A], fb: => F[B], fc: => F[C])(f: (A, B, C) => D): F[D]

Attributes

Inherited from:
Applicative
def apply4[A, B, C, D, E](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D])(f: (A, B, C, D) => E): F[E]

Attributes

Inherited from:
Applicative
def apply5[A, B, C, D, E, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E])(f: (A, B, C, D, E) => R): F[R]

Attributes

Inherited from:
Applicative
def apply6[A, B, C, D, E, FF, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF])(f: (A, B, C, D, E, FF) => R): F[R]

Attributes

Inherited from:
Applicative
def apply7[A, B, C, D, E, FF, G, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G])(f: (A, B, C, D, E, FF, G) => R): F[R]

Attributes

Inherited from:
Applicative
def apply8[A, B, C, D, E, FF, G, H, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H])(f: (A, B, C, D, E, FF, G, H) => R): F[R]

Attributes

Inherited from:
Applicative
def apply9[A, B, C, D, E, FF, G, H, I, R](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E], ff: => F[FF], fg: => F[G], fh: => F[H], fi: => F[I])(f: (A, B, C, D, E, FF, G, H, I) => R): F[R]

Attributes

Inherited from:
Applicative
def as[A, B](fa: F[A])(b: => B): F[B]

Attributes

Inherited from:
Functor
def filterM[A](l: List[A])(f: A => F[Boolean]): F[List[A]]

Filter l according to an applicative predicate.

Filter l according to an applicative predicate.

Attributes

Inherited from:
Applicative
def lift10[A, B, C, D, E, FF, G, H, I, J, R](f: (A, B, C, D, E, FF, G, H, I, J) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J]) => F[R]

Attributes

Inherited from:
Applicative
def lift11[A, B, C, D, E, FF, G, H, I, J, K, R](f: (A, B, C, D, E, FF, G, H, I, J, K) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J], F[K]) => F[R]

Attributes

Inherited from:
Applicative
def lift12[A, B, C, D, E, FF, G, H, I, J, K, L, R](f: (A, B, C, D, E, FF, G, H, I, J, K, L) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J], F[K], F[L]) => F[R]

Attributes

Inherited from:
Applicative
def lift2[A, B, C](f: (A, B) => C): (F[A], F[B]) => F[C]

Attributes

Inherited from:
Applicative
def lift3[A, B, C, D](f: (A, B, C) => D): (F[A], F[B], F[C]) => F[D]

Attributes

Inherited from:
Applicative
def lift4[A, B, C, D, E](f: (A, B, C, D) => E): (F[A], F[B], F[C], F[D]) => F[E]

Attributes

Inherited from:
Applicative
def lift5[A, B, C, D, E, R](f: (A, B, C, D, E) => R): (F[A], F[B], F[C], F[D], F[E]) => F[R]

Attributes

Inherited from:
Applicative
def lift6[A, B, C, D, E, FF, R](f: (A, B, C, D, E, FF) => R): (F[A], F[B], F[C], F[D], F[E], F[FF]) => F[R]

Attributes

Inherited from:
Applicative
def lift7[A, B, C, D, E, FF, G, R](f: (A, B, C, D, E, FF, G) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G]) => F[R]

Attributes

Inherited from:
Applicative
def lift8[A, B, C, D, E, FF, G, H, R](f: (A, B, C, D, E, FF, G, H) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H]) => F[R]

Attributes

Inherited from:
Applicative
def lift9[A, B, C, D, E, FF, G, H, I, R](f: (A, B, C, D, E, FF, G, H, I) => R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I]) => F[R]

Attributes

Inherited from:
Applicative
def point[A](a: => A): F[A]

Attributes

Inherited from:
Applicative
final def pure[A](a: => A): F[A]

Attributes

Inherited from:
Applicative
def sequence[A, G[_]](as: G[F[A]])(using evidence$1: Traverse[G]): F[G[A]]

Attributes

Inherited from:
Applicative
def traverse[A, G[_], B](value: G[A])(f: A => F[B])(using G: Traverse[G]): F[G[B]]

Attributes

Inherited from:
Applicative
def tuple2[A, B](fa: => F[A], fb: => F[B]): F[(A, B)]

Attributes

Inherited from:
Applicative
def tuple3[A, B, C](fa: => F[A], fb: => F[B], fc: => F[C]): F[(A, B, C)]

Attributes

Inherited from:
Applicative
def tuple4[A, B, C, D](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D]): F[(A, B, C, D)]

Attributes

Inherited from:
Applicative
def tuple5[A, B, C, D, E](fa: => F[A], fb: => F[B], fc: => F[C], fd: => F[D], fe: => F[E]): F[(A, B, C, D, E)]

Attributes

Inherited from:
Applicative
def unless[A](cond: Boolean)(f: => F[A]): F[Unit]

Returns the given argument if cond is false, otherwise, unit lifted into F.

Returns the given argument if cond is false, otherwise, unit lifted into F.

Attributes

Inherited from:
Applicative
def void[A](fa: F[A]): F[Unit]

Attributes

Inherited from:
Functor
def when[A](cond: Boolean)(f: => F[A]): F[Unit]

Returns the given argument if cond is true, otherwise, unit lifted into F.

Returns the given argument if cond is true, otherwise, unit lifted into F.

Attributes

Inherited from:
Applicative
def xmap[A, B](fa: F[A], f: A => B, g: B => A): F[B]

Attributes

Inherited from:
Functor