require Functions
requireTrue
Returns the specified error if the value is false
.
Function Signature
Examples
Example 1
Example 2
requireFalse
Returns the specified error if the value is true
.
Function Signature
Examples
Example 1
Example 2
requireSome
Converts an Option to a Result, using the given error if None.
Function Signature
Examples
Example 1
Example 2
requireNone
Converts an Option to a Result, using the given error if Some.
Function Signature
Examples
Example 1
Example 2
requireValueSome
Converts an ValueOption to a Result, using the given error if ValueNone.
Function Signature
Examples
Example 1
Example 2
requireValueNone
Converts an ValueOption to a Result, using the given error if ValueSome.
Function Signature
Examples
Example 1
Example 2
requireNotNull
Converts a nullable value to a Result, using the given error if null.
Function Signature
Examples
Example 1
Example 2
requireEqual
Returns Ok if the two values are equal, or the specified error if not. Same as requireEqualTo
, but with a parameter order that fits normal function application better than piping.
Function Signature
Examples
Example 1
Example 2
requireEqualTo
Returns Ok if the two values are equal, or the specified error if not. Same as requireEqual
, but with a parameter order that fits piping better than normal function application.
Function Signature
Examples
Example 1
Example 2
requireEmpty
Returns Ok if the sequence is empty, or the specified error if not.
Function Signature
Examples
Example 1
Example 2
requireNotEmpty
Returns the specified error if the sequence is empty, or Ok if not.
Function Signature
Examples
Example 1
Example 2
requireHead
Returns the first item of the sequence if it exists, or the specified error if the sequence is empty
Function Signature
Examples
Example 1
Example 2
Last updated