option -package:Cabal
option x p will either parse p or return x
without consuming any input.
option x p tries to apply parser
p. If
p
fails without consuming input, it returns the value
x,
otherwise the value returned by
p.
priority = option 0 (do{ d <- digit
; return (digitToInt d)
})
Builder for an option using the given reader.
This is a regular option, and should always have either a
long or
short name specified in the modifiers (or
both).
nameParser = option str ( long "name" <> short 'n' )
option x p tries to apply action
p. If
p
fails without consuming input, it returns the value
x,
otherwise the value returned by
p.
priority = option 0 (digitToInt <$> digit)
Combinator for the
<option> element.
Example:
option $ span $ toHtml "foo"
Result:
<option><span>foo</span></option>
option x p tries to apply parser
p. If
p
fails without consuming input, it returns the value
x,
otherwise the value returned by
p.
priority = option 0 (do{ d <- digit
; return (digitToInt d)
})
option x p tries to apply the parser
p. If
p fails without consuming input, it returns the value
x, otherwise the value returned by
p.
option x p = p <|> pure x
See also:
optional.
option x p tries to apply parser
p. If
p
fails without consuming input, it returns the value
x,
otherwise the value returned by
p.
priority = option 0 (digitToInt <$> digit)
Transform a parser to a succeed with an empty value instead of failing
See also:
optional
>>> match (option "1" <> "2") "12"
["12"]
>>> match (option "1" <> "2") "2"
["2"]
option x p will either parse p or return x
without consuming any input.
option def p will try to parse p and, if it fails,
simply return def without consuming any input.
option x p will either parse p or return x
without consuming any input.
option x p will either parse p or return x
without consuming any input.
option x p tries to apply parser p. If p
fails without consuming input, it returns the value x,
otherwise the value returned by p.
Apply a list of options to a plot resolving any pending options.
Parse something if you can, else return first value
option a p = p // unit a