Logo GenPRES

Option Module

Chooses between two option values with a comparison, giving the minimum or the maximum. When only one option holds a value, the result is this option.

Nested modules

Modules Description

Tests

Holds the Unquote tests of the Option functions.

Functions and values

Function or value Description

Option.choose cp opt1 opt2

Full Usage: Option.choose cp opt1 opt2

Parameters:
    cp : 'a -> 'a -> bool
    opt1 : 'a option
    opt2 : 'a option

Returns: 'a option
Type parameters: 'a

Choose opt1 or opt2 based on a predicate function cp

cp : 'a -> 'a -> bool
opt1 : 'a option
opt2 : 'a option
Returns: 'a option

Option.max opt1 opt2

Full Usage: Option.max opt1 opt2

Parameters:
    opt1 : 'a option
    opt2 : 'a option

Returns: 'a option
Type parameters: 'a (requires comparison)

choose the maximum of two options

opt1 : 'a option
opt2 : 'a option
Returns: 'a option

Option.min opt1 opt2

Full Usage: Option.min opt1 opt2

Parameters:
    opt1 : 'a option
    opt2 : 'a option

Returns: 'a option
Type parameters: 'a (requires comparison)

Choose the minimum of two options

opt1 : 'a option
opt2 : 'a option
Returns: 'a option

Option.none arg1

Full Usage: Option.none arg1

Parameters:
    arg0 : 'a

Returns: 'b option
Type parameters: 'a, 'b

Create a None

arg0 : 'a
Returns: 'b option

Type something to start searching.