Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => MonadIO (m :: Type -> Type) where
- asks :: MonadReader r m => (r -> a) -> m a
- ask :: MonadReader r m => m r
- type FormatTable = Map Char (Maybe Text)
- fromFormatString :: FormatTable -> String -> Text -> Either String Text
- formatFullDate :: Maybe Day -> Maybe Text
- formatYear :: Maybe Day -> Maybe Text
- data Tagger = AtomicParsley
- formatStringsForTagger :: Tagger -> (Text, Text)
- data Config = Config {}
- defaultConfig :: Tagger -> Config
- configFileName :: IO FilePath
- readConfig :: MonadIO m => ExceptT String m Config
- writeConfig :: MonadIO m => Config -> ExceptT String m FilePath
- data Vimeta m a
- data Context = Context {}
- die :: Monad m => String -> Vimeta m a
- runIO :: MonadIO m => IO a -> Vimeta m a
- runIOE :: MonadIO m => IO (Either String a) -> Vimeta m a
- tmdb :: MonadIO m => TheMovieDB a -> Vimeta m a
- verbose :: MonadIO m => Text -> Vimeta m ()
- execVimetaWithContext :: Context -> Vimeta m a -> m (Either String a)
- execVimeta :: MonadIO m => (Config -> Config) -> Vimeta m a -> m (Either String a)
- runVimeta :: MonadIO m => Vimeta m a -> m (Either String a)
- tagFile :: String -> Vimeta IO ()
- parseMappingFile :: MonadIO m => FilePath -> Parser a -> Vimeta m [(FilePath, a)]
- withArtwork :: MonadIO m => [Text] -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a
- withDownload :: MonadIO m => Maybe Text -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a
Documentation
class Monad m => MonadIO (m :: Type -> Type) where #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Instances
MonadIO IO | Since: base-4.9.0.0 |
Defined in Control.Monad.IO.Class | |
MonadIO TheMovieDB | |
Defined in Network.API.TheMovieDB.Internal.TheMovieDB liftIO :: IO a -> TheMovieDB a # | |
MonadIO m => MonadIO (Byline m) | |
Defined in System.Console.Byline.Internal.Byline | |
MonadIO m => MonadIO (ResourceT m) | |
Defined in Control.Monad.Trans.Resource.Internal | |
MonadIO m => MonadIO (Vimeta m) Source # | |
Defined in Vimeta.Core.Vimeta | |
MonadIO m => MonadIO (IdentityT m) | |
Defined in Control.Monad.Trans.Identity | |
MonadIO m => MonadIO (ExceptT e m) | |
Defined in Control.Monad.Trans.Except | |
(Error e, MonadIO m) => MonadIO (ErrorT e m) | |
Defined in Control.Monad.Trans.Error | |
MonadIO m => MonadIO (ReaderT r m) | |
Defined in Control.Monad.Trans.Reader | |
MonadIO m => MonadIO (ConduitT i o m) | |
Defined in Data.Conduit.Internal.Conduit | |
MonadIO m => MonadIO (ParsecT s u m) | |
Defined in Text.Parsec.Prim | |
MonadIO m => MonadIO (Pipe l i o u m) | |
Defined in Data.Conduit.Internal.Pipe |
:: MonadReader r m | |
=> (r -> a) | The selector function to apply to the environment. |
-> m a |
Retrieves a function of the current environment.
ask :: MonadReader r m => m r #
Retrieves the monad environment.
type FormatTable = Map Char (Maybe Text) Source #
Mapping of format characters to their possible replacement text.
:: FormatTable | Format character mapping. |
-> String | Name of format string. |
-> Text | Input text. |
-> Either String Text | Output text or error. |
Replace format characters prefixed with a %
with the
replacement text found in the given Map
.
Vimeta configuration.
Config | |
|
defaultConfig :: Tagger -> Config Source #
configFileName :: IO FilePath Source #
Get the name of the configuration file.
readConfig :: MonadIO m => ExceptT String m Config Source #
Read the configuration file and return a Config
value or an error.
Context | |
|
tmdb :: MonadIO m => TheMovieDB a -> Vimeta m a Source #
Run a TheMovieDB
operation.
:: MonadIO m | |
=> (Config -> Config) | Modify configuration before running. |
-> Vimeta m a | The Vimeta value to execute. |
-> m (Either String a) | The result. |
Run a Vimeta
operation after loading the configuration file
from disk.
runVimeta :: MonadIO m => Vimeta m a -> m (Either String a) Source #
Simple wrapper around execVimeta
.
:: MonadIO m | |
=> FilePath | File name for the mapping file. |
-> Parser a | Parser for the second column. |
-> Vimeta m [(FilePath, a)] |
Parse a mapping file.
withArtwork :: MonadIO m => [Text] -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a Source #
Try to download artwork and run the given function. The
function will be passed a FilePath
if the artwork was downloaded.
See the withDownload
function for more details.
:: MonadIO m | |
=> Maybe Text | URL. |
-> (Maybe FilePath -> Vimeta IO a) | Function to call and pass the file name to. |
-> Vimeta m a | Result of above function. |
Download the given URL to a temporary file and pass the file name to the given function.
The reason a function needs to be passed to withDownload
is the
result of using withSystemTempFile
to store the downloaded file.
The file will be automatically removed after the given function
completes.