CmdLineParser

ghc-7.8.2: The GHC API

Safe Haskell | None
Language | Haskell98

CmdLineParser

Description

Command-line parser

This is an abstract command-line parser used by both StaticFlags and DynFlags.

(c) The University of Glasgow 2005

# Documentation

processArgs :: Monad m => [Flag m] -> [Located String] -> m ([Located String], [Located String], [Located String]) Source

data OptKind m Source

Constructors

NoArg (EwM m ()) |
HasArg (String -> EwM m ()) |
SepArg (String -> EwM m ()) |
Prefix (String -> EwM m ()) |
OptPrefix (String -> EwM m ()) |
OptIntSuffix (Maybe Int -> EwM m ()) |
IntSuffix (Int -> EwM m ()) |
FloatSuffix (Float -> EwM m ()) |
PassFlag (String -> EwM m ()) |
AnySuffix (String -> EwM m ()) |
PrefixPred (String -> Bool) (String -> EwM m ()) |
AnySuffixPred (String -> Bool) (String -> EwM m ()) |
VersionSuffix (Int -> Int -> EwM m ()) |

newtype CmdLineP s a Source

Constructors

CmdLineP |
Fields runCmdLine :: s -> (a, s)

Instances

Monad (CmdLineP s) |
Functor (CmdLineP s) |
Applicative (CmdLineP s) |

getCmdLineState :: CmdLineP s s Source

putCmdLineState :: s -> CmdLineP s () Source

data Flag m Source

Constructors

Flag |
Fields flagName :: String flagOptKind :: OptKind m

errorsToGhcException :: [Located String] -> GhcException Source

data EwM m a Source

Instances

Monad m => Monad (EwM m) |
Monad m => Functor (EwM m) |
Monad m => Applicative (EwM m) |

addErr :: Monad m => String -> EwM m () Source

addWarn :: Monad m => String -> EwM m () Source

getArg :: Monad m => EwM m String Source

getCurLoc :: Monad m => EwM m SrcSpan Source

liftEwM :: Monad m => m a -> EwM m a Source

deprecate :: Monad m => String -> EwM m () Source