*/*: Drop stable ia64 keywords
[gentoo.git] / dev-haskell / readargs / metadata.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3 <pkgmetadata>
4         <maintainer type="project">
5                 <email>haskell@gentoo.org</email>
6                 <name>Gentoo Haskell</name>
7         </maintainer>
8         <longdescription>
9                 ReadArgs provides the @readArgs@ IO action, which lets you tell the compiler
10                 to parse the command line arguments to fit the type signature you give.
11                 
12                 For example @(a :: Int, b :: String, c :: Float) &lt;- readArgs@ would
13                 parse the first runtime argument as an @Int@, the second as a @String@ (no
14                 quotes required) and the third as a @Float@.
15                 
16                 If the runtime arguments are incompatible with the type signature,
17                 then a simple usage statement is given of the types needed.
18                 
19                 Continuing the previous example, if it was used in a
20                 program named @Example@, the error message for the above
21                 action would be:
22                 
23                 @
24                 usage: Example Int String Float
25                 @
26                 
27                 Any type that has both @Typeable@ and @Read@ instances
28                 can be used. @Char@, @String@, and @Text@ are handled specially so that
29                 command line arguments for both do not require quotes (as their
30                 @Read@ instances do). A special instance is provided for @FilePath@ so
31                 that no constructor or quotes are required.
32                 
33                 @readArgs@ also supports optional arguments and variadic arguments.
34                 Optional arguments are specified using @Maybe@, and variadic arguments
35                 using a list.  @(a :: Int, b :: Maybe String, c :: [Float]) &lt;- readArgs@
36                 would successfully parse any of the following sets of command line arguments:
37                 
38                 @
39                 Example 1
40                 Example 1 2 3 4
41                 Example 1 foo
42                 Example 1 foo 2 3 4
43                 @
44                 
45                 But not
46                 
47                 @
48                 Example
49                 Example foo
50                 Example 1.0
51                 @
52                 
53                 Usage statements for optional and variadic arguments use command-line
54                 parlance:
55                 
56                 @
57                 usage: Example Int [String] [Float..]
58                 @
59                 
60                 Note that both optional and variadic parsers are greedy by default
61                 (so @Example 1 2 3 4@ was parsed as @(1, "2", [3.0,4.0])@.  They
62                 may both be made non-greedy through use of the @NonGreedy@ constructor:
63                 
64                 @
65                 ( a :: Int
66                 , NonGreedy b :: NonGreedy Maybe String
67                 , NonGreedy c :: NonGreedy [] Float
68                 ) &lt;- readArgs
69                 @
70         </longdescription>
71         <upstream>
72                 <remote-id type="github">rampion/ReadArgs</remote-id>
73         </upstream>
74 </pkgmetadata>