You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submitted by Cameron Taggart on 6/26/2014 12:00:00 AM 13 votes on UserVoice prior to migration
Many APIs and types support the use of null. To help remove null and promote the use of option, It would be good to add a standard function that can be used to wrap nullable types.
May be something like:
type Option<'A> with
static member ofNull (t:'T when 'T : null) = function
| null -> None
| x -> Some x http://stackoverflow.com/questions/24418816/in-the-f-api-is-there-something-like-option-ofnull
add Option.ofNull to help remove nulls [6103054]
Submitted by Cameron Taggart on 6/26/2014 12:00:00 AM
13 votes on UserVoice prior to migration
Many APIs and types support the use of null. To help remove null and promote the use of option, It would be good to add a standard function that can be used to wrap nullable types.
May be something like:
type Option<'A> with
static member ofNull (t:'T when 'T : null) = function
| null -> None
| x -> Some x
http://stackoverflow.com/questions/24418816/in-the-f-api-is-there-something-like-option-ofnull
Response
** by fslang-admin on 1/21/2015 12:00:00 AM **
Completed for F# 4.0, see https://visualfsharp.codeplex.com/SourceControl/network/forks/dsyme/cleanup/contribution/7672
Don Syme, F# Language/Library Evolution
Original UserVoice Submission
Archived Uservoice Comments
The text was updated successfully, but these errors were encountered: