Safe Haskell | None |
---|---|
Language | GHC2021 |
Command-line parser
This is an abstract command-line parser used by DynFlags.
(c) The University of Glasgow 2005
Synopsis
- processArgs :: Monad m => [Flag m] -> [Located String] -> (FilePath -> EwM m [Located String]) -> m ([Located String], [Err], Warns)
- parseResponseFile :: forall (m :: Type -> Type). MonadIO m => FilePath -> EwM m [Located String]
- data OptKind (m :: Type -> Type)
- = 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 ())
- | Word64Suffix (Word64 -> EwM m ())
- | FloatSuffix (Float -> EwM m ())
- | PassFlag (String -> EwM m ())
- | AnySuffix (String -> EwM m ())
- data GhcFlagMode
- data Flag (m :: Type -> Type) = Flag {
- flagName :: String
- flagOptKind :: OptKind m
- flagGhcMode :: GhcFlagMode
- defFlag :: forall (m :: Type -> Type). String -> OptKind m -> Flag m
- defGhcFlag :: forall (m :: Type -> Type). String -> OptKind m -> Flag m
- defGhciFlag :: forall (m :: Type -> Type). String -> OptKind m -> Flag m
- defHiddenFlag :: forall (m :: Type -> Type). String -> OptKind m -> Flag m
- hoistFlag :: (forall a. m a -> n a) -> Flag m -> Flag n
- errorsToGhcException :: [(String, String)] -> GhcException
- newtype Err = Err {}
- type Warn = Located DriverMessage
- warnsToMessages :: DiagOpts -> [Warn] -> Messages DriverMessage
- data EwM (m :: Type -> Type) a
- runEwM :: EwM m a -> m (Errs, Warns, a)
- addErr :: forall (m :: Type -> Type). Monad m => String -> EwM m ()
- addWarn :: forall (m :: Type -> Type). Monad m => String -> EwM m ()
- addFlagWarn :: forall (m :: Type -> Type). Monad m => DriverMessage -> EwM m ()
- getArg :: forall (m :: Type -> Type). Monad m => EwM m String
- getCurLoc :: forall (m :: Type -> Type). Monad m => EwM m SrcSpan
- liftEwM :: Monad m => m a -> EwM m a
Documentation
parseResponseFile :: forall (m :: Type -> Type). MonadIO m => FilePath -> EwM m [Located String] Source #
Parse a response file into arguments.
data OptKind (m :: Type -> Type) 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 ()) | |
Word64Suffix (Word64 -> 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.
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 |
data Flag (m :: Type -> Type) Source #
Flag | |
|
errorsToGhcException :: [(String, String)] -> GhcException Source #
type Warn = Located DriverMessage Source #
A command-line warning message and the reason it arose
This used to be own type, but now it's just
.MsgEnvelope
DriverMessage
warnsToMessages :: DiagOpts -> [Warn] -> Messages DriverMessage Source #
addFlagWarn :: forall (m :: Type -> Type). Monad m => DriverMessage -> EwM m () Source #