FSharp.Core


Nullable Module

Functions for converting nullable values

Functions and values

Function or value Description

Nullable.byte value

Full Usage: Nullable.byte value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<byte> The converted byte
Modifiers: inline
Type parameters: ^T

Converts the argument to byte. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<byte>

The converted byte

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.byte (Nullable<int>())  // evaluates to Nullable<byte>()
 Nullable.byte (Nullable<int>(3))  // evaluates to Nullable(3uy)

Nullable.char value

Full Usage: Nullable.char value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<char> The converted char.
Modifiers: inline
Type parameters: ^T

Converts the argument to character. Numeric inputs are converted according to the UTF-16 encoding for characters. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<char>

The converted char.

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.char (Nullable<int>())  // evaluates to Nullable<char>()
 Nullable.char (Nullable<int>(64))  // evaluates to Nullable<char>('@')

Nullable.decimal value

Full Usage: Nullable.decimal value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<decimal> The converted decimal.
Modifiers: inline
Type parameters: ^T

Converts the argument to System.Decimal using a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<decimal>

The converted decimal.

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.decimal (Nullable<int>())  // evaluates to Nullable<decimal>()
 Nullable.decimal (Nullable<int>(3))  // evaluates to Nullable<decimal>(3.0M)

Nullable.double value

Full Usage: Nullable.double value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<double> The converted float
Modifiers: inline
Type parameters: ^T

Converts the argument to 64-bit float. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<double>

The converted float

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.double (Nullable<int>())  // evaluates to Nullable<double>()
 Nullable.double (Nullable<int>(3))  // evaluates to Nullable<double>(3.0)

Nullable.enum value

Full Usage: Nullable.enum value

Parameters:
Returns: Nullable<^U> The converted enum type.
Modifiers: inline
Type parameters: ^U

Converts the argument to a particular enum type.

value : Nullable<int32>

The input value.

Returns: Nullable<^U>

The converted enum type.

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.enum<DayOfWeek> (Nullable<int>())  // evaluates to Nullable<uint>()
 Nullable.enum<DayOfWeek> (Nullable<int>(3))  // evaluates to Nullable<DayOfWeek>(Wednesday)

Nullable.float value

Full Usage: Nullable.float value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<float> The converted float
Modifiers: inline
Type parameters: ^T

Converts the argument to 64-bit float. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<float>

The converted float

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.float (Nullable<int>())  // evaluates to Nullable<float>()
 Nullable.float (Nullable<int>(3))  // evaluates to Nullable<float>(3.0)

Nullable.float32 value

Full Usage: Nullable.float32 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<float32> The converted float32
Modifiers: inline
Type parameters: ^T

Converts the argument to 32-bit float. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<float32>

The converted float32

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.float32 (Nullable<int>())  // evaluates to Nullable<float32>()
 Nullable.float32 (Nullable<int>(3))  // evaluates to Nullable<float32>(3.0f)

Nullable.int value

Full Usage: Nullable.int value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<int> The converted int
Modifiers: inline
Type parameters: ^T

Converts the argument to signed 32-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<int>

The converted int

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.int (Nullable<int64>())  // evaluates to Nullable<int>()
 Nullable.int (Nullable<int64>(3))  // evaluates to Nullable(3)

Nullable.int16 value

Full Usage: Nullable.int16 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<int16> The converted int16
Modifiers: inline
Type parameters: ^T

Converts the argument to signed 16-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<int16>

The converted int16

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.int16 (Nullable<int>())  // evaluates to Nullable<int16>()
 Nullable.int16 (Nullable<int>(3))  // evaluates to Nullable(3s)

Nullable.int32 value

Full Usage: Nullable.int32 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<int32> The converted int32
Modifiers: inline
Type parameters: ^T

Converts the argument to signed 32-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<int32>

The converted int32

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.int32 (Nullable<int64>())  // evaluates to Nullable<int32>()
 Nullable.int32 (Nullable<int64>(3))  // evaluates to Nullable(3)

Nullable.int64 value

Full Usage: Nullable.int64 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<int64> The converted int64
Modifiers: inline
Type parameters: ^T

Converts the argument to signed 64-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<int64>

The converted int64

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.int64 (Nullable<int>())  // evaluates to Nullable<int64>()
 Nullable.int64 (Nullable<int>(3))  // evaluates to Nullable<int64>(3L)

Nullable.int8 value

Full Usage: Nullable.int8 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<int8> The converted sbyte
Modifiers: inline
Type parameters: ^T

Converts the argument to signed byte. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<int8>

The converted sbyte

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.int8 (Nullable<int>())  // evaluates to Nullable<sbyte>()
 Nullable.int8 (Nullable<int>(3))  // evaluates to Nullable(3y)

Nullable.nativeint value

Full Usage: Nullable.nativeint value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<nativeint> The converted nativeint
Modifiers: inline
Type parameters: ^T

Converts the argument to signed native integer. This is a direct conversion for all primitive numeric types. Otherwise the operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<nativeint>

The converted nativeint

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.nativeint (Nullable<int>())  // evaluates to Nullable<nativeint>()
 Nullable.nativeint (Nullable<int>(3))  // evaluates to Nullable<nativeint>(3n)

Nullable.sbyte value

Full Usage: Nullable.sbyte value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<sbyte> The converted sbyte
Modifiers: inline
Type parameters: ^T

Converts the argument to signed byte. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<sbyte>

The converted sbyte

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.sbyte (Nullable<int>())  // evaluates to Nullable<sbyte>()
 Nullable.sbyte (Nullable<int>(3))  // evaluates to Nullable(3y)

Nullable.single value

Full Usage: Nullable.single value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<single> The converted float32
Modifiers: inline
Type parameters: ^T

Converts the argument to 32-bit float. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<single>

The converted float32

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.single (Nullable<int>())  // evaluates to Nullable<float32>()
 Nullable.single (Nullable<int>(3))  // evaluates to Nullable<float32>(3.0f)

Nullable.uint value

Full Usage: Nullable.uint value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<uint> The converted unsigned integer
Modifiers: inline
Type parameters: ^T

Converts the argument to an unsigned 32-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<uint>

The converted unsigned integer

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.uint (Nullable<int>())  // evaluates to Nullable<uint>()
 Nullable.uint (Nullable<int>(3))  // evaluates to Nullable(3u)

Nullable.uint16 value

Full Usage: Nullable.uint16 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<uint16> The converted uint16
Modifiers: inline
Type parameters: ^T

Converts the argument to unsigned 16-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<uint16>

The converted uint16

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.uint16 (Nullable<int>())  // evaluates to Nullable<uint16>()
 Nullable.uint16 (Nullable<int>(3))  // evaluates to Nullable(3us)

Nullable.uint32 value

Full Usage: Nullable.uint32 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<uint32> The converted uint32
Modifiers: inline
Type parameters: ^T

Converts the argument to unsigned 32-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<uint32>

The converted uint32

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.uint32 (Nullable<int>())  // evaluates to Nullable<uint32>()
 Nullable.uint32 (Nullable<int>(3))  // evaluates to Nullable(3u)

Nullable.uint64 value

Full Usage: Nullable.uint64 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<uint64> The converted uint64
Modifiers: inline
Type parameters: ^T

Converts the argument to unsigned 64-bit integer. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<uint64>

The converted uint64

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.uint64 (Nullable<int>())  // evaluates to Nullable<uint64>()
 Nullable.uint64 (Nullable<int>(3))  // evaluates to Nullable<uint64>(3UL)

Nullable.uint8 value

Full Usage: Nullable.uint8 value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<uint8> The converted byte
Modifiers: inline
Type parameters: ^T

Converts the argument to byte. This is a direct conversion for all primitive numeric types. The operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<uint8>

The converted byte

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.uint8 (Nullable<int>())  // evaluates to Nullable<byte>()
 Nullable.uint8 (Nullable<int>(3))  // evaluates to Nullable(3uy)

Nullable.unativeint value

Full Usage: Nullable.unativeint value

Parameters:
    value : Nullable<^T> - The input value.

Returns: Nullable<unativeint> The converted unativeint
Modifiers: inline
Type parameters: ^T

Converts the argument to unsigned native integer using a direct conversion for all primitive numeric types. Otherwise the operation requires an appropriate static conversion method on the input type.

value : Nullable<^T>

The input value.

Returns: Nullable<unativeint>

The converted unativeint

Example

 open System
 open FSharp.Linq.NullableOperators

 Nullable.unativeint (Nullable<int>())  // evaluates to Nullable<unativeint>()
 Nullable.unativeint (Nullable<int>(3))  // evaluates to Nullable<unativeint>(3un)