Arg

Arg isn't itself a Semigroup in its own right, but it can be placed inside Min and Max to compute an arg min or arg max. In the event of ties, the leftmost qualifying Arg is chosen; contrast with the behavior of minimum and maximum for many other types, where ties are broken by considering elements to the left in the structure to be less than elements to the right.

Examples

>>> minimum [ Arg (x * x) x | x <- [-10 .. 10] ]
Arg 0 0
>>> maximum [ Arg (-0.2*x^2 + 1.5*x + 1) x | x <- [-10 .. 10] ]
Arg 3.8 4.0
>>> minimum [ Arg (-0.2*x^2 + 1.5*x + 1) x | x <- [-10 .. 10] ]
Arg (-34.0) (-10.0)
Type synonym for expressions that occur in function argument positions. Only Arg should contain a Type at top level, general Expr should not
An unnamed argument. Anything not starting with - is considered an argument, apart from "-" which is considered to be the argument "-", and any arguments following "--". For example:
programname arg1 -j - --foo arg3 -- -arg4 --arg5=1 arg6
Would have the arguments:
["arg1","-","arg3","-arg4","--arg5=1","arg6"]
Arg isn't itself a Semigroup in its own right, but it can be placed inside Min and Max to compute an arg min or arg max.
>>> minimum [ Arg (x * x) x | x <- [-10 .. 10] ]
Arg 0 0
Arg isn't itself a Semigroup in its own right, but it can be placed inside Min and Max to compute an arg min or arg max.
>>> minimum [ Arg (x * x) x | x <- [-10 .. 10] ]
Arg 0 0
Constraint helper for types with parameters Usage:
data A a = A a
deriving (Generic)
instance (Arg (A a) a, Arbitrary a) => Arbitrary (A a) where
arbitrary = genericArbitrary
shrink = genericShrink
The description of an argument, suitable for messages and for parsing. The argData field is used both for flags with a data argument, and for positional data arguments. There are two cases:
  1. The argument is a flag, in which case at least one of argAbbr and argName is provided;
  2. The argument is positional, in which case neither argAbbr nor argName are provided, but argData is.
If none of argAbbr, argName, or argData are provided, this is an error. See also the argDataRequired, argDataOptional, and argDataDefaulted functions below, which are used to generate argData.
Maps a name to the foreign type that belongs to the annotated value. Used for header args, query args, and capture args.
Match on an argument without specifying its name. See also: arg.
An argument applied to a function data constructor primitive.
Input hole