I suggest we ...

Properly print 'None' for option types from FSI

FSI output properly handles 'Some x', but often prints 'None' as 'null', apparently when the value is part of a larger type.

let x : uint16 option = None
correctly results in: val x : uint16 option = None

let y : string * uint16 option = "", None
instead prints: val y : string * uint16 option = ("", null)

18 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    TeaDrivenDev _ shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • FANG Colin commented  · 

        > printfn "%A" (1, None)
        printfn "%A" None
        printfn "%O" (1, None)
        printfn "%O" None
        (1, null)
        <null>
        (1, )
        <null>

      • Grant Crofton commented  · 

        Yes please, this can be pretty annoying (especially when trying to show people F#)

      F# Language

      Feedback and Knowledge Base