Table of contents
TOC
Collapse the table of content
Expand the table of content

Core.Option Module (F#)

Den Delimarsky|Last Updated: 7/8/2016
|
2 Contributors

Basic operations on options.

Namespace/Module Path: Microsoft.FSharp.Core

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

module Option

Remarks

For an overview of options in F#, see Options (F#).

Values

ValueDescription
bind
: ('T -> 'U option) -> 'T option -> 'U option
Invokes a function on an optional value that itself yields an option.
count
: 'T option -> int
Evaluates the equivalent of Set.count for an option.
exists
: ('T -> bool) -> 'T option -> bool
Evaluates the equivalent of List.exists for an option.
filter
:('T -> bool) -> 'T option -> 'T option
Evaluates whether the value contained in the option should remain, or be filtered out.
fold
: ('State -> 'T -> 'State) -> 'State -> 'T option -> 'State
Evaluates the equivalent of List.fold for an option.
foldBack
: ('T -> 'State -> 'State) -> 'T option -> 'State -> 'State
Performs the equivalent of the List.foldBack operation on an option.
forall
: ('T -> bool) -> 'T option -> bool
Evaluates the equivalent of List.forall for an option type.
get
: 'T option -> 'T
Gets the value associated with the option.
isNone
: 'T option -> bool
Returns true if the option is None.
isSome
: 'T option -> bool
Returns true if the option is not None.
iter
: ('T -> unit) -> 'T option -> unit
Executes a function for an option value.
map
: ('T -> 'U) -> 'T option -> 'U option
Transforms an option value by using a specified mapping function.
toArray
: 'T option -> 'T []
Convert the option to an array of length 0 or 1.
toList
: 'T option -> 'T list
Convert the option to a list of length 0 or 1.
toNullable
: 'T option -> Nullable<'T>
Convert the option to a Nullable value.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Microsoft.FSharp.Core Namespace (F#)

© 2016 Microsoft