lambda-options-0.9.1.0: Declarative command line parser using type-driven pattern matching.

Safe HaskellSafe
LanguageHaskell2010

Text.LambdaOptions.Keyword

Synopsis

Documentation

data Keyword Source #

An option keyword, such as "--help"

Constructors

Keyword 

Fields

  • kwNames :: [String]

    All the aliases for this keyword.

  • kwArgText :: String

    Text to describe the arguments to the option given by this keyword.

  • kwText :: String

    Text to describe the function of the option given by this keyword.

Instances

Eq Keyword Source # 

Methods

(==) :: Keyword -> Keyword -> Bool #

(/=) :: Keyword -> Keyword -> Bool #

Data Keyword Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Keyword -> c Keyword #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Keyword #

toConstr :: Keyword -> Constr #

dataTypeOf :: Keyword -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Keyword) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Keyword) #

gmapT :: (forall b. Data b => b -> b) -> Keyword -> Keyword #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Keyword -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Keyword -> r #

gmapQ :: (forall d. Data d => d -> u) -> Keyword -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Keyword -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Keyword -> m Keyword #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Keyword -> m Keyword #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Keyword -> m Keyword #

Ord Keyword Source # 
Show Keyword Source # 
IsString Keyword Source # 

Methods

fromString :: String -> Keyword #

ToKeyword Keyword Source #

Identiy mapping.

class ToKeyword a where Source #

Convenience Keyword creation class.

Minimal complete definition

toKeyword

Methods

toKeyword :: a -> Keyword Source #

Instances

ToKeyword String Source #

Used to create a Keyword with a single alias.

ToKeyword Keyword Source #

Identiy mapping.

ToKeyword [String] Source #

Used to create a Keyword with many (or no) aliases

kw :: ToKeyword a => a -> Keyword Source #

Shorthand for toKeyword.

argText :: Keyword -> String -> Keyword Source #

Sets the kwArgText field in the keyword. Intended to be used infix:

kw "--directory" `argText` "DIR" `text` "Write files to DIR."

text :: Keyword -> String -> Keyword Source #

Sets the kwText field in the keyword. Intended to be used infix.

kw "--quiet" `text` "Suppress message display."