- type App config = ReaderT (AppContext config) IO
- appArgs :: Default config => App config [String]
- appConfig :: Default config => App config config
- data (Default opts, Default config) => Application opts config = Application {
- appName :: String
- appVersion :: String
- appBugEmail :: String
- appAuthors :: [String]
- appShortDesc :: String
- appLongDesc :: String
- appCategories :: [String]
- appProject :: String
- appSeeAlso :: [String]
- appCmds :: [Command config]
- appOptions :: [OptDescr opts]
- appProcessConfig :: config -> [opts] -> IO config
- data Default config => Command config = Command {
- cmdName :: String
- cmdHandler :: App config ()
- cmdCategory :: String
- cmdSynopsis :: String
- cmdShortDesc :: String
- cmdExamples :: [(String, String)]
- defCmd :: Command ()
- appMain :: Application () () -> IO ()
- appMainWithOptions :: (Default opts, Default config) => Application opts config -> IO ()
Documentation
data (Default opts, Default config) => Application opts config Source
It is often simpler to use the default implementation of Application, and override it with the details you choose to use. For example, an implementation of the ''hello'' command:
hello = def { appName = "hello", appVersion = "0.1", appAuthors = ["Joe R. Hacker"], appBugEmail = "bugs@example.com", appShortDesc = "UI.Command example program", appLongDesc = longDesc, appCategories = ["Greetings", "Cat Math"], appSeeAlso = ["tractorgen"], appProject = "Haskell", appCmds = [world, times] } longDesc = "a demonstration program for the UI.Command framework."
Application | |
|
(Default opts, Default config) => Default (Application opts config) |
data Default config => Command config Source
It is often simpler to use the default implementation of Command, and override it with the details you choose to use. For example, an implementation of the ''hello world'' command:
world = def { cmdName = "world", cmdHandler = worldHandler, cmdCategory = "Greetings", cmdShortDesc = "An implementation of the standard software greeting." } worldHandler = liftIO $ putStrLn "Hello world!"
Command | |
|
appMainWithOptions :: (Default opts, Default config) => Application opts config -> IO ()Source