| Safe Haskell | Safe-Inferred |
|---|
System.Console.CmdTheLine.Term
Contents
- eval :: [String] -> (Term a, TermInfo) -> IO a
- exec :: (Term a, TermInfo) -> IO a
- run :: (Term (IO a), TermInfo) -> IO a
- unwrap :: [String] -> (Term a, TermInfo) -> IO (Either EvalExit a)
- evalChoice :: [String] -> (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO a
- execChoice :: (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO a
- runChoice :: (Term (IO a), TermInfo) -> [(Term (IO a), TermInfo)] -> IO a
- unwrapChoice :: [String] -> (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO (Either EvalExit a)
- data EvalExit
Evaluating Terms
Simple command line programs
exec :: (Term a, TermInfo) -> IO aSource
exec ( term, termInfo ) executes a command line program, directly grabbing the command line arguments from the environment and returning the result upon successful evaluation of term. On failure the program exits.
Multi-command command line programs
evalChoice :: [String] -> (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO aSource
evalChoice args mainTerm choices is analogous to eval, but for programs that provide a choice of commands.
execChoice :: (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO aSource
Analogous to exec, but for programs that provide a choice of commands.
runChoice :: (Term (IO a), TermInfo) -> [(Term (IO a), TermInfo)] -> IO aSource
Analogous to run, but for programs that provide a choice of commands.
unwrapChoice :: [String] -> (Term a, TermInfo) -> [(Term a, TermInfo)] -> IO (Either EvalExit a)Source
Analogous to unwrap, but for programs that provide a choice of commands.
Exit information for testing
Information about the way a Term exited early. Obtained by either unwraping or unwrapChoiceing some Term. Handy for testing programs when it is undesirable to exit execution of the entire program when a Term exits early.