Union Functions
Name | Description | Complexity |
isDefined(T|Unit): Boolean | Checks if an argument is not unit | 1 |
value(T|Unit): T | Gets a value from a union type argument. Fails if it is unit | 2 |
valueOrElse(T|Unit, T): T | Returns a value from a union type argument if it's not unit . Otherwise, returns the second argument | 2 |
valueOrErrorMessage(T|Unit, String): T | Gets a value from a union type argument if it's not unit . Otherwise, fails with the message specified in the second argument | 2 |
isDefined(T|Unit): Boolean
Checks if an argument is not unit
.
Parameter | Description |
a : T|Unit | Argument to check |
value(T|Unit): T
Gets a value from a union type argument. Fails if it is unit.
Parameter | Description |
a : T|Unit | Argument to return value from |
valueOrElse(T|Unit, T): T
Returns a value from a union type argument if it's not unit. Otherwise, returns the second argument.
Parameter | Description |
t : T|Unit | Argument to return value from |
t0 : T | Returned if t is unit |
valueOrErrorMessage(T|Unit, String): T
Gets a value from a union type argument if it's not unit. Otherwise, fails with the message specified in the second argument.
Parameter | Description |
a : T|Unit | Argument to return value from |
msg : String | Error message |