Created by MarkPerry on 30/12/13.
| Type | Name and description |
|---|---|
M<B> |
ap(M<A> ma, M<F<A, B>> mf)Sequence computations and combine their results. |
M<B> |
apply(M<F<A, B>> t1, M<A> t2)Implements Applicative.apply using Monad combinators (<*>) :: f (a -> b) -> f a -> f b |
F<A, M<C>> |
compose(F<B, M<C>> f, F<A, M<B>> 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<java.util.List<A>> |
filterM(java.util.List<A> list, F<A, M<java.lang.Boolean>> f)This generalizes the list-based filter function. |
M<B> |
flatMap(M<A> ma, F<A, M<B>> 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 |
fj.F2<M<A>, F<A, M<B>>, M<B>> |
flatMap() |
M<B> |
foldM(fj.data.Stream<A> s, B b, fj.F2<B, A, M<B>> f)The foldM function is analogous to foldl, except that its result is encapsulated in a monad. |
M<B> |
foldM(java.util.List<A> s, B b, fj.F2<B, A, M<B>> f) |
M<fj.Unit> |
foldM_(fj.data.Stream<A> s, B b, fj.F2<B, A, M<B>> f)Like foldM, but discards the result. |
M<fj.Unit> |
foldM_(java.util.List<A> s, B b, fj.F2<B, A, M<B>> f) |
M<A> |
join(M<M<A>> mma)The join function is the conventional monad join operator. |
M<B> |
liftM(M<A> ma, F<A, B> f)Promote a function to a monad. |
M<R> |
liftM2(M<A> ma, M<B> mb, fj.F2<A, B, R> f)Promote a function to a monad, scanning the monadic arguments from left to right. |
M<R> |
liftM3(M<A> ma, M<B> mb, M<C> mc, fj.F3<A, B, C, R> f)Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). |
M<B> |
map(M<A> ma, F<A, B> f)Implements Functor interface using Monad combinators fmap :: (a -> b) -> f a -> f b |
M<C> |
map2(M<A> ma, M<B> mb, fj.F2<A, B, C> f) |
M<A> |
pure(A a)Implements Applicative.pure using Monad combinators pure :: a -> f a |
M<java.util.List<A>> |
replicateM(java.lang.Integer n, M<A> ma)replicateM n act performs the action n times, gathering the results. |
M<java.util.List<A>> |
sequence(java.util.List<M<A>> list)Evaluate each action in the sequence from left to right, and collect the results. |
M<fj.Unit> |
skip(M<A> ma) |
M<B> |
to(M<A> ma, B b) |
M<java.util.List<B>> |
traverse(java.util.List<A> list, F<A, M<B>> f)Map each element of a structure to an action, evaluate these actions from left to right and collect the results. |
M<B> |
unit(B b)Inject a value into the monadic type. |
F<B, M<B>> |
unit()Returns a function representing unit |
M<fj.Unit> |
unless(java.lang.Boolean b, M<fj.Unit> m)The reverse of when. |
M<fj.Unit> |
when(java.lang.Boolean b, M<fj.Unit> m)Conditional execution of monadic expressions. |
| Methods inherited from class | Name |
|---|---|
class Applicative |
apply, left, liftA, liftA2, liftA2_, liftA3, pure, right, sequenceA |
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Sequence computations and combine their results. In many situations, the liftM operations can be replaced by uses of ap, which promotes function application. return f `ap` x1 `ap` ... `ap` xn is equivalent to liftMn f x1 x2 ... xn ap :: Monad m => m (a -> b) -> m a -> m b Source
Implements Applicative.apply using Monad combinators (<*>) :: f (a -> b) -> f a -> f b
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-
This generalizes the list-based filter function. Arguments flipped compared to Haskell representation filterM :: Monad m => (a -> m Bool) -> [a] -> m [a]
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
The foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue where (>>) and the `folded function' are not commutative. foldM :: Monad m => (a -> b -> m a) -> a -> [b] -> m a Arguments are in different order
Like foldM, but discards the result. foldM_ :: Monad m => (a -> b -> m a) -> a -> [b] -> m ()
The join function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level. join :: Monad m => m (m a) -> m a
Promote a function to a monad. liftM :: Monad m => (a1 -> r) -> m a1 -> m r
Promote a function to a monad, scanning the monadic arguments from left to right. For example, liftM2 (+) [0,1] [0,2] = [0,2,1,3] liftM2 (+) (Just 1) Nothing = Nothing liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
Implements Functor interface using Monad combinators fmap :: (a -> b) -> f a -> f b
Implements Applicative.pure using Monad combinators pure :: a -> f a
replicateM n act performs the action n times, gathering the results. replicateM :: Monad m => Int -> m a -> m [a] Source
Evaluate each action in the sequence from left to right, and collect the results.
Map each element of a structure to an action, evaluate these actions from left to right and collect the results.
Inject a value into the monadic type. return :: a -> m a
Returns a function representing unit
The reverse of when. unless :: Monad m => Bool -> m () -> m () Source
Conditional execution of monadic expressions. For example, when debug (putStr "Debugging\n") will output the string Debugging\n if the Boolean value debug is True, and otherwise do nothing. when :: Monad m => Bool -> m () -> m ()