Safe Haskell | None |
---|---|
Language | Haskell2010 |
- mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b
- data ResourceT (m :: * -> *) a :: (* -> *) -> * -> *
- runConduitRes :: MonadUnliftIO m => ConduitM () Void (ResourceT m) r -> m r
- runResourceT :: MonadUnliftIO m => ResourceT m a -> m a
- liftResourceT :: MonadIO m => ResourceT IO a -> ResourceT m a
- newtype NoLogging a = NoLogging {
- runNoLogging :: IO a
- withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a
- fromFirst :: a -> First a -> a
- mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]
- mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
- forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b]
- forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b]
- stripCR :: Text -> Text
- logSticky :: MonadLogger m => Text -> m ()
- logStickyDone :: MonadLogger m => Text -> m ()
- newtype RIO env a = RIO {}
- runRIO :: MonadIO m => env -> RIO env a -> m a
- class HasLogFunc env where
Documentation
data ResourceT (m :: * -> *) a :: (* -> *) -> * -> * #
The Resource transformer. This transformer keeps track of all registered
actions, and calls them upon exit (via runResourceT
). Actions may be
registered via register
, or resources may be allocated atomically via
allocate
. allocate
corresponds closely to bracket
.
Releasing may be performed before exit via the release
function. This is a
highly recommended optimization, as it will ensure that scarce resources are
freed early. Note that calling release
will deregister the action, so that
a release action will only ever be called once.
Since 0.3.0
runConduitRes :: MonadUnliftIO m => ConduitM () Void (ResourceT m) r -> m r Source #
runResourceT :: MonadUnliftIO m => ResourceT m a -> m a Source #
Avoid orphan messes
NoLogging | |
|
withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a Source #
Path version
forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b] Source #
logSticky :: MonadLogger m => Text -> m () Source #
Write a "sticky" line to the terminal. Any subsequent lines will
overwrite this one, and that same line will be repeated below
again. In other words, the line sticks at the bottom of the output
forever. Running this function again will replace the sticky line
with a new sticky line. When you want to get rid of the sticky
line, run logStickyDone
.
logStickyDone :: MonadLogger m => Text -> m () Source #
This will print out the given message with a newline and disable
any further stickiness of the line until a new call to logSticky
happens.
It might be better at some point to have a runSticky
function
that encompasses the logSticky->logStickyDone pairing.
The Reader+IO monad. This is different from a ReaderT
because:
- It's not a transformer, it hardcodes IO for simpler usage and error messages.
- Instances of typeclasses like
MonadLogger
are implemented using classes defined on the environment, instead of using an underlying monad.
MonadReader env (RIO env) Source # | |
Monad (RIO env) Source # | |
Functor (RIO env) Source # | |
Applicative (RIO env) Source # | |
MonadThrow (RIO env) Source # | |
MonadIO (RIO env) Source # | |
MonadUnliftIO (RIO env) Source # | |
HasLogFunc env => MonadLogger (RIO env) Source # | |
HasLogFunc env => MonadLoggerIO (RIO env) Source # | |
class HasLogFunc env where Source #