Monad

libretto.lambda.util.Monad
See theMonad companion object
trait Monad[F[_]] extends Functor[F]

Witnesses that F is a monad in the category of Scala functions.

Attributes

Companion
object
Graph
Supertypes
trait Functor[F]
class Object
trait Matchable
class Any
Known subtypes
object monadId

Members list

Value members

Abstract methods

def pure[A](a: A): F[A]

Concrete fields

lazy val applicative: Applicative[F]

An Applicative derived from this Monad instance.

An Applicative derived from this Monad instance.

Note that it is intentional that

  • Monad is not made to extend Applicative.
  • The Applicative derived from this Monad (i.e. this field) is not given. The reason is that we often want to use a different Applicative instance by default.

Attributes

Extensions

Extensions

extension [A](fa: F[A])
infix def *>[B](fb: F[B]): F[B]
infix def >>[B](fb: => F[B]): F[B]
infix def flatMap[B](f: A => F[B]): F[B]
infix override def map[B](f: A => B): F[B]

Attributes

Definition Classes
def void: F[Unit]
extension [A](ffa: F[F[A]])
def flatten: F[A]

Inherited extensions

extension [A](fa: F[A])
def widen[B >: A]: F[B]

Attributes

Inherited from:
Functor