Safe Haskell | Safe-Inferred |
---|
- skip :: Monad m => m ()
- discard :: Monad m => a -> m ()
- obvious :: Applicative f => f ()
- bind :: Monad m => m a -> (a -> m b) -> m b
- om :: Monad m => (a -> b -> m c) -> m a -> b -> m c
- nom :: Monad m => (a -> b -> m c) -> a -> m b -> m c
- doCallCC :: Monad m => ((r -> ContT r m b) -> ContT r m r) -> m r
- label :: ContT r m (ContT r m a)
- io :: MonadIO m => IO a -> m a
- liftMaybe :: MonadPlus m => Maybe a -> m a
- embed :: MonadBaseControl base m => (a -> m b) -> m (a -> base (StM m b))
- embedIO :: (MonadBaseControl IO m, MonadIO m) => (a -> m b) -> m (a -> IO b)
- embedIO2 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> m r) -> m (a -> b -> IO r)
- embedIO3 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> m r) -> m (a -> b -> c -> IO r)
- embedIO4 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> m r) -> m (a -> b -> c -> d -> IO r)
- embedIO5 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> m r) -> m (a -> b -> c -> d -> e -> IO r)
- embedIO6 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> m r) -> m (a -> b -> c -> d -> e -> f -> IO r)
- embedIO7 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> IO r)
- embedIO8 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> h -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> h -> IO r)
- embedIO9 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> h -> i -> IO r)
- sequenceUntil :: Monad m => (a -> Bool) -> [m a] -> m [a]
Documentation
obvious :: Applicative f => f ()Source
Synonym for pure ()
.
om :: Monad m => (a -> b -> m c) -> m a -> b -> m cSource
Combinator for working with monadic values:
>>>
om when (return True) $ print "Hello"
"Hello">>>
return True >>= flip when (print "Hello")
"Hello">>>
om forM_ (return [True]) print
True>>>
flip forM_ print =<< return [True]
True>>>
mapM_ print =<< return [True]
True
Subsumes the need for individual functions for whenM
, unlessM
, etc.
nom :: Monad m => (a -> b -> m c) -> a -> m b -> m cSource
Variant of om
which changes the roles of the 2nd and 3rd arguments.
>>>
nom mapM_ print $ return [True]
True>>>
mapM_ print =<< return [True]
True
doCallCC :: Monad m => ((r -> ContT r m b) -> ContT r m r) -> m rSource
Convenience function if all you want to use is
callCC
.
label :: ContT r m (ContT r m a)Source
Return a continuation that one can jump back to within ContT
.
>>>
flip runContT return $ do { k <- label; ...; k }
liftMaybe :: MonadPlus m => Maybe a -> m aSource
Lift a Maybe
value into the MaybeT
monad transformer.
embed :: MonadBaseControl base m => (a -> m b) -> m (a -> base (StM m b))Source
Embed a transformer (Kleisli) arrow as an arrow in the base monad
returning a mutated transformer state. If you do not want the
transformation and your base monad is IO, use embedIO
.
embedIO :: (MonadBaseControl IO m, MonadIO m) => (a -> m b) -> m (a -> IO b)Source
Return an IO action that closes over the current monad transformer, but throws away any residual effects within that transformer.
embedIO2 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> m r) -> m (a -> b -> IO r)Source
embedIO3 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> m r) -> m (a -> b -> c -> IO r)Source
embedIO4 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> m r) -> m (a -> b -> c -> d -> IO r)Source
embedIO5 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> m r) -> m (a -> b -> c -> d -> e -> IO r)Source
embedIO6 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> m r) -> m (a -> b -> c -> d -> e -> f -> IO r)Source
embedIO7 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> IO r)Source
embedIO8 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> h -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> h -> IO r)Source
embedIO9 :: (MonadBaseControl IO m, MonadIO m) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> m r) -> m (a -> b -> c -> d -> e -> f -> g -> h -> i -> IO r)Source
sequenceUntil :: Monad m => (a -> Bool) -> [m a] -> m [a]Source
Draw monadic actions from a list until one of them yields a value failing the predicate, and then return all the passing values in a list within that monad.