// [snippet:Printing None results in <null>] None |> printfn "Value: %A" // Value: // [/snippet] // [snippet:Custom implementation of Option<'T> - Printing None results in None] type MyOption<'T> = | Some of 'T | None MyOption.None |> printfn "Value: %A" // Value: None // [/snippet] // [snippet:Revised MyOption<'T> - Printing None results in <null>] // Here, MyOption2<'T> is decorated with CompilationRepresentationAttribute and // the UseNullAsTrueValue flag is set just like it is for Option<'T> in the F# // library. This is how None is represented in the compiled code. // See http://bit.ly/1cA0QfS for more info about CompilationRepresentation [] type MyOption2<'T> = | Some of 'T | None MyOption2.None |> printfn "Value: %A" // Value: // [/snippet]