meow.control

package meow.control

Type members

Classlikes

trait Applicative[F[_]]

A functor with application, providing operations to

A functor with application, providing operations to

  • embed pure expressions ('pure'), and
  • sequence computations and combine their results ('<*>' and 'liftA2').

A minimal complete definition must include implementations of 'pure' and 'liftA2'.

Further, any definition must satisfy the following:

Identity

pure[F](identity) <*> fa == fa

Composition

pure[F](compose) <*> fa <*> fb <*> fc == fa <*> (fb <*> fc)

Homomorphism

pure[F](f) <*> pure(x) == (pure[F](f(x)))

Interchange

u <*> pure(y) == pure[F]((f: String => String) => f(y)) <*> u
Companion
object
object Applicative
Companion
class
enum Lan[G[_], H[_], A]
Companion
object
object Lan
Companion
class
trait Monad[M[_]]

The Monad trait defines the basic operations over a /monad/, a concept from a branch of mathematics known as /category theory/. From the perspective of a Haskell programmer, however, it is best to think of a monad as an /abstract datatype/ of actions. Scala's for expressions provide a convenient syntax for writing monadic expressions.

The Monad trait defines the basic operations over a /monad/, a concept from a branch of mathematics known as /category theory/. From the perspective of a Haskell programmer, however, it is best to think of a monad as an /abstract datatype/ of actions. Scala's for expressions provide a convenient syntax for writing monadic expressions.

Instances of 'Monad' should satisfy the following:

Left identity

(pure[F](a) >>= f) == f(a)

Right identity

(fa >>= {(x: A) => pure[F](x) }) == fa

Associativity

(m >>= { (x: A) => k(x) >>= h }) == ((m >>= k) >>= h)

Furthermore, the 'Monad' and 'Applicative' operations should relate as follows:

map[F](f)(xs) == (xs >>= (pure[F] compose f))
>> == *>

and that meow.control.Applicative#pure and meow.control.Applicative#&lt;*&gt; satisfy the Applicative functor laws.

Companion
object
object Monad

Instances and static functions for meow.control.Monad

Instances and static functions for meow.control.Monad

Companion
class
case class Ran[G[_], H[_], A](run: [B] => (x$1: A => G[B]) => H[B])
Companion
object
object Ran
Companion
class

Givens

Givens

given apRan[G[_]]: Applicative[[_] =>> Ran[G, G, _$13]]
given given_Functor_Ran[G[_], H[_]]: Functor[[_] =>> Ran[G, H, _$11]]
given given_Monad_Ran[G[_]]: Monad[[_] =>> Ran[G, G, _$15]]