ScallopOption
A class to hold a reference to not-yet-computed option values.
A class to hold a reference to not-yet-computed option values.
Basically, this is a lazy option - it batches up all operations, and evaluates the value only as the last resort.
- Value Params
- _transformCount
Count of .map, .filter, etc. operations applied to this option
- cliOption
option descriptor (names, converters, validatiors, etc.)
- nm
Name for the option
Type members
Classlikes
Value members
Concrete methods
Retreive the underlying value. Use only if you are completely sure that there is a value.
Retreive the underlying value. Use only if you are completely sure that there is a value.
Returns ScallopOption, that contains the result of applying pf
to the value, if this option is non-empty and pf is defined for that value.
Returns empty ScallopOption otherwise.
Returns ScallopOption, that contains the result of applying pf
to the value, if this option is non-empty and pf is defined for that value.
Returns empty ScallopOption otherwise.
- Value Params
- pf
the partial function
Returns ScallopOption, that contains the value if applying predicate p to this value returned true. No value otherwise.
Returns ScallopOption, that contains the value if applying predicate p to this value returned true. No value otherwise.
- Value Params
- p
the predicate used for testing
Returns ScallopOption, that contains the value if applying predicate p to this value returned false. No value otherwise.
Returns ScallopOption, that contains the value if applying predicate p to this value returned false. No value otherwise.
- Value Params
- p
the predicate used for testing
Returns the result of applying f th this options value if this option is non-empty.
Returns the result of applying f th this options value if this option is non-empty.
Apply the given procedure f to the option's value, if it is nonempty.
Apply the given procedure f to the option's value, if it is nonempty.
Retrieve the underlying value if the option is nonempty, otherwise return the result of evaluating default
.
Retrieve the underlying value if the option is nonempty, otherwise return the result of evaluating default
.
A convenience method to check whether the underlying option is defined. Just an alias for opt.get.isDefined.
A convenience method to check whether the underlying option is defined. Just an alias for opt.get.isDefined.
A convenience method to check whether the underlying option is empty. Just an alias for !opt.isDefined.
A convenience method to check whether the underlying option is empty. Just an alias for !opt.isDefined.
Tests whether the underlying value was explicitly supplied by user.
Tests whether the underlying value was explicitly supplied by user.
Returns ScallopOption, that contains the result of applying
f
to this option's value, if this option is non-empty.
Returns ScallopOption with no value otherwise.
Returns ScallopOption, that contains the result of applying
f
to this option's value, if this option is non-empty.
Returns ScallopOption with no value otherwise.
- Value Params
- f
the function to apply
Returns ScallopOption with this value if it is non-empty, or with the value of the alternative option. If it is empty too, the resulting ScallopOption will contain None.
Returns ScallopOption with this value if it is non-empty, or with the value of the alternative option. If it is empty too, the resulting ScallopOption will contain None.
- Value Params
- alternative
the alternative expression