ghc-7.6.3: The GHC API

Safe Haskell | None

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])

data OptKind m

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 ()) |
PassFlag (String -> EwM m ()) |
AnySuffix (String -> EwM m ()) |
PrefixPred (String -> Bool) (String -> EwM m ()) |
AnySuffixPred (String -> Bool) (String -> EwM m ()) |

newtype CmdLineP s a

Constructors

CmdLineP |

Fields

runCmdLine :: s -> (a, s)

Instances

Monad (CmdLineP s) |

getCmdLineState :: CmdLineP s s

putCmdLineState :: s -> CmdLineP s ()

data Flag m

Constructors

Flag |

Fields

flagName :: String
flagOptKind :: OptKind m

errorsToGhcException :: [Located String] -> GhcException

data EwM m a

Instances

Monad m => Monad (EwM m) |

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 ()