Safe Haskell | None |
---|---|
Language | Haskell2010 |
Command-line parser
This is an abstract command-line parser used by both StaticFlags and DynFlags.
(c) The University of Glasgow 2005
- processArgs :: Monad m => [Flag m] -> [Located String] -> m ([Located String], [Located String], [Located String])
- data OptKind m
- = 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 ())
- data GhcFlagMode
- newtype CmdLineP s a = CmdLineP {
- runCmdLine :: s -> (a, s)
- getCmdLineState :: CmdLineP s s
- putCmdLineState :: s -> CmdLineP s ()
- data Flag m = Flag {
- flagName :: String
- flagOptKind :: OptKind m
- flagGhcMode :: GhcFlagMode
- defFlag :: String -> OptKind m -> Flag m
- defGhcFlag :: String -> OptKind m -> Flag m
- defGhciFlag :: String -> OptKind m -> Flag m
- defHiddenFlag :: String -> OptKind m -> Flag m
- errorsToGhcException :: [Located String] -> GhcException
- data EwM m a
- runEwM :: EwM m a -> m (Errs, Warns, a)
- addErr :: Monad m => String -> EwM m ()
- addWarn :: Monad m => String -> EwM m ()
- getArg :: Monad m => EwM m String
- getCurLoc :: Monad m => EwM m SrcSpan
- liftEwM :: Monad m => m a -> EwM m a
- deprecate :: Monad m => String -> EwM m ()
Documentation
processArgs :: Monad m => [Flag m] -> [Located String] -> m ([Located String], [Located String], [Located String]) Source
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 ()) |
data GhcFlagMode Source
GHC flag modes describing when a flag has an effect.
OnlyGhc | The flag only affects the non-interactive GHC |
OnlyGhci | The flag only affects the interactive GHC |
AllModes | The flag affects multiple ghc modes |
HiddenFlag | This flag should not be seen in cli completion |
CmdLineP | |
|
getCmdLineState :: CmdLineP s s Source
putCmdLineState :: s -> CmdLineP s () Source
Flag | |
|
defGhcFlag :: String -> OptKind m -> Flag m Source
defGhciFlag :: String -> OptKind m -> Flag m Source
defHiddenFlag :: String -> OptKind m -> Flag m Source