meow.control
Type members
Classlikes
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
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#<*> satisfy the Applicative functor laws.
- Companion
- object
Instances and static functions for meow.control.Monad
Instances and static functions for meow.control.Monad
- Companion
- class