Copyright | (c) Simon Bergot |
---|---|
License | BSD3 |
Maintainer | simon.bergot@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Functions used to specify a parser for command line arguments.
- class ParamSpec spec where
- getParser :: spec res -> Parser res
- getParamDescr :: spec res -> [ParamDescr]
- liftParam :: ParamSpec spec => spec res -> ParserSpec res
- parsedBy :: ParamSpec spec => (a -> b) -> spec a -> ParserSpec b
- andBy :: ParamSpec spec => ParserSpec (a -> b) -> spec a -> ParserSpec b
- subParser :: ParamSpec spec => (a -> b) -> spec a -> ParserSpec b
Documentation
class ParamSpec spec where Source
interface allowing to define a basic block of a command line parser
getParser :: spec res -> Parser res Source
getParamDescr :: spec res -> [ParamDescr] Source
liftParam :: ParamSpec spec => spec res -> ParserSpec res Source
Converts any ParamSpec
to a ParserSpec
parsedBy :: ParamSpec spec => (a -> b) -> spec a -> ParserSpec b infixl 1 Source
Build a parser from a type constructor and a ParamSpec
MyApp `parsedBy` myparamspec
andBy :: ParamSpec spec => ParserSpec (a -> b) -> spec a -> ParserSpec b infixl 1 Source
Build a parser from a parser and a ParamSpec
MyApp `parsedBy` myparamspec `andBy` myotherparamspec
subParser :: ParamSpec spec => (a -> b) -> spec a -> ParserSpec b infixr 3 Source
This is parsedBy
with a different fixity.