Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

numOption

🌌numOption

numOption -- optional numeric values

This is a pseudo-numeric type that handles one additional
value: nil. Any operation on nil will result in nil for a
numeric result or false for a boolean result.


redefines Object.asString:

monadic operator

Same as non-generic >>=, but also maps to a different type B.

Does this option contain a value of type T?

basic infix operations

comparison

monadic operator
redefines monad.infix >>=:
monadic operator within the same monad

Apply f to elements of type A and re-wrap them in this monad.

monadic operator for bool result, false for nil

Does this option contain no value of type T?

short-hand postfix operator for 'isNil'

short-hand postfix operator for 'exists'

basic prefix operations

value of an option that is known to contain a value

this can only be called in cases where it is known for sure that this option
is not nil. A runtime error will be created otherwise.