Logo GenPRES

DtoResult Module

Replaces a string or array that is null after JSON deserialization by an empty value, and collects results into all values or all errors.

Functions and values

Function or value Description

blankToNull s

Full Usage: blankToNull s

Parameters:
    s : string

Returns: string

Returns null for a null or empty string, and the string otherwise. orBlank reads null back as an empty string.

s : string
Returns: string

orBlank s

Full Usage: orBlank s

Parameters:
    s : string

Returns: string

Returns the string, or an empty string when the string is null after JSON deserialization.

s : string
Returns: string

orEmpty xs

Full Usage: orEmpty xs

Parameters:
    xs : 'a[]

Returns: 'a[]
Type parameters: 'a

Returns the array, or an empty array when the array is null after JSON deserialization.

xs : 'a[]
Returns: 'a[]

sequence rs

Full Usage: sequence rs

Parameters:
Returns: Result<'a list, 'e list>
Type parameters: 'a, 'e

Returns every value when all results are Ok, otherwise every error.

rs : Result<'a, 'e> list
Returns: Result<'a list, 'e list>

Type something to start searching.