|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.github.mperry.fg.typeclass.Applicative
com.github.mperry.fg.typeclass.Monad
@groovy.transform.TypeChecked(TypeCheckingMode.SKIP) abstract class Monad extends Applicative
Created by MarkPerry on 30/12/13.
| Method Summary | |
|---|---|
M
|
ap(M ma, M mf)
In many situations, the liftM operations can be replaced by uses of ap, which promotes function application. |
M
|
apply(M t1, M t2)
Implements Applicative.apply using Monad combinators (<*>) :: f (a -> b) -> f a -> f b |
F
|
compose(F f, F g)
Right-to-left Kleisli composition of monads. (>=>), with the arguments flipped http://hackage.haskell.org/package/base-4.6.0.1/docs/Control-Monad.html#v:-60--61--60- |
M
|
filterM(java.util.List list, F f)
This generalizes the list-based filter function. |
M
|
flatMap(M ma, F f)
Sequentially compose two actions, passing any value produced by the first as an argument to the second. (>>=) :: forall a b. m a -> (a -> m b) -> m b |
M
|
fmap(F f, M ma)
Implements Functor interface using Monad combinators fmap :: (a -> b) -> f a -> f b |
M
|
foldM(Stream s, B b, F2 f)
The foldM function is analogous to foldl, except that its result is encapsulated in a monad. |
M
|
foldM(java.util.List s, B b, F2 f)
|
M
|
foldM_(Stream s, B b, F2 f)
Like foldM, but discards the result. |
M
|
foldM_(java.util.List s, B b, F2 f)
|
M
|
join(M mma)
The join function is the conventional monad join operator. |
M
|
liftM(M ma, F f)
Promote a function to a monad. |
M
|
liftM2(M ma, M mb, F2 f)
Promote a function to a monad, scanning the monadic arguments from left to right. |
M
|
liftM3(M ma, M mb, M mc, F3 f)
Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). |
M
|
map(M ma, F f)
|
M
|
map2(M ma, M mb, F2 f)
|
M
|
pure(A a)
Implements Applicative.pure using Monad combinators pure :: a -> f a |
M
|
replicateM(java.lang.Integer n, M ma)
replicateM n act performs the action n times, gathering the results. |
M
|
sequence(java.util.List list)
Evaluate each action in the sequence from left to right, and collect the results. |
M
|
skip(M ma)
|
M
|
to(M ma, B b)
|
M
|
traverse(java.util.List list, F f)
Map each element of a structure to an action, evaluate these actions from left to right and collect the results. |
M
|
unit(B b)
Inject a value into the monadic type. |
F
|
unit()
Returns a function representing unit |
M
|
unless(java.lang.Boolean b, M m)
The reverse of when. |
M
|
when(java.lang.Boolean b, M m)
Conditional execution of monadic expressions. |
| Methods inherited from class Applicative | |
|---|---|
| apply, left, liftA, liftA2, liftA3, pure, right |
| Method Detail |
|---|
M ap(M ma, M mf)
M apply(M t1, M t2)
F compose(F f, F g)
M filterM(java.util.List list, F f)
M flatMap(M ma, F f)
M fmap(F f, M ma)
M foldM(Stream s, B b, F2 f)
M foldM(java.util.List s, B b, F2 f)
M foldM_(Stream s, B b, F2 f)
M foldM_(java.util.List s, B b, F2 f)
M join(M mma)
M liftM(M ma, F f)
M liftM2(M ma, M mb, F2 f)
M liftM3(M ma, M mb, M mc, F3 f)
M map(M ma, F f)
M map2(M ma, M mb, F2 f)
M pure(A a)
M replicateM(java.lang.Integer n, M ma)
M sequence(java.util.List list)
M skip(M ma)
M to(M ma, B b)
M traverse(java.util.List list, F f)
M unit(B b)
F unit()
M unless(java.lang.Boolean b, M m)
M when(java.lang.Boolean b, M m)
Groovy Documentation