question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

F# values display badly in default formatting, esp plaintext

See original GitHub issue

Therer are lots of cases where default formatting for F# values is way off. I’ll document a few here and try and make progress on this.

  1. Evaluate a method info, e…d

    match <@ display("") @> with Quotations.Patterns.Call(_,mi,_) -> mi
    

    Expect: something reasonable Actual: a big mess

  2. Evaluate “<@ 1 @>” in a notebook.

    Expect: Some reasonable of the quotation.
    Actual, a big mess, see image at bottom

    Best would really be just the ToString() I think:

    Value (1)
    

    For reference FSI shows this, which is not great but not awful.

        val it : Quotations.Expr<int> =
      Value (1)
     {CustomAttributes = [NewTuple (Value ("DebugRange"),
           NewTuple (Value ("stdin"), Value (1), Value (3), Value (1), Value (4)))];
      Raw = ...;
      Type = System.Int32;}
    

Quotation image:

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
dsymecommented, Jul 14, 2020

FWIW I think the best approach here in the short term would be “revert to printing plain text of F# values unless we are sure the result is going to look nice”

And use https://github.com/dotnet/interactive/issues/646 to control printing in plain text.

Exactly what this means in detail I’m not sure

1reaction
jonsequiturcommented, Oct 23, 2020

My current thinking is that we can allow this decision to be different per subkernel by adding support for subkernels specifying their own formatting rules, so for example the FSharpKernel could prefer FSI-style printing. C# doesn’t have a comparable mechanism and perhaps because of that, the feedback has been that the tabular output is more useful than ToString for most types.

In the short term this should make the F# experience better and more familiar while decoupling from the timeline for finding a better set of defaults for C#.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly read fixed-width format files
Construct two lists that show the value boundaries (we skip the "W"). These will be used to extract the substrings for the variables....
Read more >
ESP8266 Troubleshooting Guide
The ESP8266 has a few common issues when you are trying to flash a new firmware, uploading a script or during normal usage...
Read more >
86607 - UI option for disabling format=flowed
Sending format is not *your* preference, but the reciepient's one. If the recipient doesn't like f=f, he can disable it and see the...
Read more >
eSchoolPlus+ Teacher Access Center (TAC) ...
This view displays the student's standardized test information. By default, only tests for which the student has scores are displayed. To display all...
Read more >
Wireshark User's Guide
This menu controls the display of the captured data, including colorization of packets, zooming the font, showing a packet in a separate window,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found