Safe Haskell | None |
---|---|
Language | Haskell2010 |
FreeC.Monad.Application
Description
This module contains the state monad used by the compiler's command line interface to pass command line options around implicitly.
Synopsis
- data Application a
- runApp :: Application a -> IO a
- reportApp :: Application a -> Application a
- getOpts :: Application Options
- inOpts :: (Options -> a) -> Application a
- putOpts :: Options -> Application ()
- modifyOpts :: (Options -> Options) -> Application ()
- modifyOpts' :: (Options -> (a, Options)) -> Application a
- liftReporter :: MonadReporter r => Reporter a -> r a
- liftReporterIO :: ReporterIO a -> Application a
- liftConverter :: MonadConverter m => Converter a -> m a
- liftConverterIO :: ConverterIO a -> Application a
State Monad
data Application a Source #
A state monad used by the compiler application to pass the command line options implicitly.
The entire application is lifted to the ConverterIO
monad.
Instances
runApp :: Application a -> IO a Source #
Runs the compiler application.
reportApp :: Application a -> Application a Source #
Runs the given application and prints the reported messages.
Accessing and Modifying State
getOpts :: Application Options Source #
Gets the options of the application.
inOpts :: (Options -> a) -> Application a Source #
Gets a specific component of the the application's options
using the given function to extract the value from the Options
.
putOpts :: Options -> Application () Source #
Sets the options of the application.
modifyOpts :: (Options -> Options) -> Application () Source #
Modifies the options of the application.
modifyOpts' :: (Options -> (a, Options)) -> Application a Source #
Gets a specific component and modifies the options of the application.
Lifting Other Monads
liftReporter :: MonadReporter r => Reporter a -> r a Source #
Promotes a reporter to r
.
liftReporterIO :: ReporterIO a -> Application a Source #
Promotes a ReporterIO
to an application that produces the same result
and ignores the application's options.
liftConverter :: MonadConverter m => Converter a -> m a Source #
liftConverterIO :: ConverterIO a -> Application a Source #
Promotes a ConverterIO
to an application that produces the same result
and ignores the application's options.