ghc-lib-parser-8.8.0.20190424: The GHC API, decoupled from GHC versions

Safe HaskellNone
LanguageHaskell2010

CmdLineParser

Description

Command-line parser

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

(c) The University of Glasgow 2005

Synopsis

Documentation

processArgs :: Monad m => [Flag m] -> [Located String] -> m ([Located String], [Err], [Warn]) 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 ()) 

data GhcFlagMode Source #

GHC flag modes describing when a flag has an effect.

Constructors

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

newtype CmdLineP s a Source #

Constructors

CmdLineP 

Fields

Instances
Monad (CmdLineP s) Source # 
Instance details

Defined in CmdLineParser

Methods

(>>=) :: CmdLineP s a -> (a -> CmdLineP s b) -> CmdLineP s b #

(>>) :: CmdLineP s a -> CmdLineP s b -> CmdLineP s b #

return :: a -> CmdLineP s a #

fail :: String -> CmdLineP s a #

Functor (CmdLineP s) Source # 
Instance details

Defined in CmdLineParser

Methods

fmap :: (a -> b) -> CmdLineP s a -> CmdLineP s b #

(<$) :: a -> CmdLineP s b -> CmdLineP s a #

Applicative (CmdLineP s) Source # 
Instance details

Defined in CmdLineParser

Methods

pure :: a -> CmdLineP s a #

(<*>) :: CmdLineP s (a -> b) -> CmdLineP s a -> CmdLineP s b #

liftA2 :: (a -> b -> c) -> CmdLineP s a -> CmdLineP s b -> CmdLineP s c #

(*>) :: CmdLineP s a -> CmdLineP s b -> CmdLineP s b #

(<*) :: CmdLineP s a -> CmdLineP s b -> CmdLineP s a #

data Flag m Source #

Constructors

Flag 

newtype Err Source #

A command-line error message

Constructors

Err 

Fields

data Warn Source #

A command-line warning message and the reason it arose

Constructors

Warn 

data WarnReason Source #

Used when filtering warnings: if a reason is given it can be filtered out when displaying.

Instances
Eq WarnReason Source # 
Instance details

Defined in CmdLineParser

Show WarnReason Source # 
Instance details

Defined in CmdLineParser

Outputable WarnReason Source # 
Instance details

Defined in CmdLineParser

ToJson WarnReason Source # 
Instance details

Defined in CmdLineParser

data EwM m a Source #

Instances
Monad m => Monad (EwM m) Source # 
Instance details

Defined in CmdLineParser

Methods

(>>=) :: EwM m a -> (a -> EwM m b) -> EwM m b #

(>>) :: EwM m a -> EwM m b -> EwM m b #

return :: a -> EwM m a #

fail :: String -> EwM m a #

Monad m => Functor (EwM m) Source # 
Instance details

Defined in CmdLineParser

Methods

fmap :: (a -> b) -> EwM m a -> EwM m b #

(<$) :: a -> EwM m b -> EwM m a #

Monad m => Applicative (EwM m) Source # 
Instance details

Defined in CmdLineParser

Methods

pure :: a -> EwM m a #

(<*>) :: EwM m (a -> b) -> EwM m a -> EwM m b #

liftA2 :: (a -> b -> c) -> EwM m a -> EwM m b -> EwM m c #

(*>) :: EwM m a -> EwM m b -> EwM m b #

(<*) :: EwM m a -> EwM m b -> EwM m a #

runEwM :: EwM m a -> m (Errs, Warns, a) Source #

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

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

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

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