utility-ht-0.0.17.2: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe Haskell | Safe-Inferred
Language | Haskell98

Control.Monad.HT

Synopsis

- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- repeat :: Monad m => m a -> m [a]
- nest :: Monad m => Int -> (a -> m a) -> a -> m a
- untilM :: Monad m => (a -> Bool) -> m a -> m a
- until :: Monad m => (a -> Bool) -> m a -> m a
- iterateLimitM :: Monad m => Int -> (a -> m a) -> a -> m [a]
- iterateLimit :: Monad m => Int -> (a -> m a) -> a -> m [a]
- iterate :: Monad m => (a -> m a) -> a -> m [a]
- andLazy :: Monad m => m Bool -> m Bool -> m Bool
- orLazy :: Monad m => m Bool -> m Bool -> m Bool
- void :: Monad m => m a -> m ()
- for :: Monad m => [a] -> (a -> m b) -> m [b]
- map :: Monad m => (a -> m b) -> [a] -> m [b]
- zipWith :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- chain :: Monad m => [a -> m a] -> a -> m a
- filter :: Monad m => (a -> m Bool) -> [a] -> m [a]
- replicate :: Monad m => Int -> m a -> m [a]
- lift :: Monad m => (a -> r) -> m a -> m r
- lift2 :: Monad m => (a -> b -> r) -> m a -> m b -> m r
- lift3 :: Monad m => (a -> b -> c -> r) -> m a -> m b -> m c -> m r
- lift4 :: Monad m => (a -> b -> c -> d -> r) -> m a -> m b -> m c -> m d -> m r
- lift5 :: Monad m => (a -> b -> c -> d -> e -> r) -> m a -> m b -> m c -> m d -> m e -> m r
- liftJoin2 :: Monad m => (a -> b -> m c) -> m a -> m b -> m c
- liftJoin3 :: Monad m => (a -> b -> c -> m d) -> m a -> m b -> m c -> m d
- liftJoin4 :: Monad m => (a -> b -> c -> d -> m e) -> m a -> m b -> m c -> m d -> m e
- liftJoin5 :: Monad m => (a -> b -> c -> d -> e -> m f) -> m a -> m b -> m c -> m d -> m e -> m f

# Documentation

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 Source #

Also present in newer versions of the `base` package.

repeat :: Monad m => m a -> m [a] Source #

Monadic `repeat`.

nest :: Monad m => Int -> (a -> m a) -> a -> m a Source #

untilM :: Monad m => (a -> Bool) -> m a -> m a Source #

Deprecated: use M.until

repeat action until result fulfills condition

until :: Monad m => (a -> Bool) -> m a -> m a Source #

repeat action until result fulfills condition

iterateLimitM :: Monad m => Int -> (a -> m a) -> a -> m [a] Source #

Deprecated: use M.iterateLimit

parameter order equal to that of `nest`

iterateLimit :: Monad m => Int -> (a -> m a) -> a -> m [a] Source #

parameter order equal to that of `nest`

iterate :: Monad m => (a -> m a) -> a -> m [a] Source #

I think this makes only sense in a lazy monad like `Trans.State.Lazy` or `IO.Lazy`.

andLazy :: Monad m => m Bool -> m Bool -> m Bool Source #

Lazy monadic conjunction. That is, when the first action returns `False`, then `False` is immediately returned, without running the second action.

orLazy :: Monad m => m Bool -> m Bool -> m Bool Source #

Lazy monadic disjunction. That is, when the first action returns `True`, then `True` is immediately returned, without running the second action.

void :: Monad m => m a -> m () Source #

for :: Monad m => [a] -> (a -> m b) -> m [b] Source #

map :: Monad m => (a -> m b) -> [a] -> m [b] Source #

zipWith :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c] Source #

chain :: Monad m => [a -> m a] -> a -> m a Source #

filter :: Monad m => (a -> m Bool) -> [a] -> m [a] Source #

replicate :: Monad m => Int -> m a -> m [a] Source #

lift :: Monad m => (a -> r) -> m a -> m r Source #

lift2 :: Monad m => (a -> b -> r) -> m a -> m b -> m r Source #

lift3 :: Monad m => (a -> b -> c -> r) -> m a -> m b -> m c -> m r Source #

lift4 :: Monad m => (a -> b -> c -> d -> r) -> m a -> m b -> m c -> m d -> m r Source #

lift5 :: Monad m => (a -> b -> c -> d -> e -> r) -> m a -> m b -> m c -> m d -> m e -> m r Source #

liftJoin2 :: Monad m => (a -> b -> m c) -> m a -> m b -> m c Source #

liftJoin3 :: Monad m => (a -> b -> c -> m d) -> m a -> m b -> m c -> m d Source #

liftJoin4 :: Monad m => (a -> b -> c -> d -> m e) -> m a -> m b -> m c -> m d -> m e Source #

liftJoin5 :: Monad m => (a -> b -> c -> d -> e -> m f) -> m a -> m b -> m c -> m d -> m e -> m f Source #