- processArgs :: Monad m => [Flag m] -> [Located String] -> FlagSafety -> Bool -> 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 ())
- | PassFlag (String -> EwM m ())
- | AnySuffix (String -> EwM m ())
- | PrefixPred (String -> Bool) (String -> EwM m ())
- | AnySuffixPred (String -> Bool) (String -> EwM m ())
- newtype CmdLineP s a = CmdLineP {
- runCmdLine :: s -> (a, s)
- getCmdLineState :: CmdLineP s s
- putCmdLineState :: s -> CmdLineP s ()
- data Flag m = Flag {
- flagName :: String
- flagSafety :: FlagSafety
- flagOptKind :: OptKind m
- data FlagSafety
- flagA, flagN, flagC, flagR :: String -> OptKind m -> Flag m
- errorsToGhcException :: [Located String] -> GhcException
- determineSafeLevel :: Bool -> FlagSafety
- data EwM m a
- addErr :: Monad m => String -> EwM m ()
- addWarn :: Monad m => String -> EwM m ()
- getArg :: Monad m => EwM m String
- liftEwM :: Monad m => m a -> EwM m a
- deprecate :: Monad m => String -> EwM m ()
Documentation
processArgs :: Monad m => [Flag m] -> [Located String] -> FlagSafety -> Bool -> 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 ()) | |
PassFlag (String -> EwM m ()) | |
AnySuffix (String -> EwM m ()) | |
PrefixPred (String -> Bool) (String -> EwM m ()) | |
AnySuffixPred (String -> Bool) (String -> EwM m ()) |
getCmdLineState :: CmdLineP s sSource
putCmdLineState :: s -> CmdLineP s ()Source
Flag | |
|
data FlagSafety Source
This determines how a flag should behave when Safe Haskell mode is on.
EnablesSafe | This flag is a little bit of a hack. We give the safe haskell flags (-XSafe and -XSafeLanguage) this safety type so we can easily detect when safe haskell mode has been enable in a module pragma as this changes how the rest of the parsing should happen. |
AlwaysAllowed | Flag is always allowed |
RestrictedFunction | Flag is allowed but functions in a reduced way |
CmdLineOnly | Flag is only allowed on command line, not in pragma |
NeverAllowed | Flag isn't allowed at all |