New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create an fsi.RemovePrinterTransformer method #690

Open
sgtz opened this Issue Sep 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sgtz

sgtz commented Sep 8, 2018

create a fsi.RemovePrinterTransformer method

Also, a fsi.RemovePrinter would be useful

during fsi sessions, it can be useful to use alternate views of an object, but the default view then becomes inaccessible.

Pros and Cons

The advantages of making this adjustment to F# are ...

convenience. However, most power users will still find their way around okay.

Workaround

the programmer could create their own Session singleton, which their transformer then references to find out which view is currently active. The default (no transformer) still seems to be out of reach, though. Maybe there's a nice way to do this, but still, a remove method would be handy.

Examples

fsi.AddPrintTransformer(PrettyPrinting.f >> (fun x->"\n" + x) >> toObj)  // nice

fsi.AddPrintTransformer(fun (x:Table)->x:>obj) // failed attempt to reinstate default without fsi environment reset

fsi.AddPrintTransformer(fun (x:Table)->x.ToString():>obj) // etc

fsi.AddPrintTransformer(fun (x:Table)->null) // etc

Extra information

Estimated cost (XS, S, M, L, XL, XXL): S

Related suggestions: (put links to related suggestions here)

Affidavit (please submit!)

Please tick this by placing a cross in the box:

  • This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue
  • I have searched both open and closed suggestions on this site and believe this is not a duplicate
  • This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.

Please tick all that apply:

  • This is not a breaking change to the F# language design
  • I or my company would be willing to help implement and/or test this

@sgtz sgtz changed the title from create a fsi.RemovePrinterTransformer method to create an fsi.RemovePrinterTransformer method Sep 8, 2018

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Oct 9, 2018

Collaborator

I'm fine with making sure there's some way to remove these things (e.g. RegisterPrintTransformer returning an IDisposable)

No RFC needed, it should just be done in vlsualfsharp repo

Collaborator

dsyme commented Oct 9, 2018

I'm fine with making sure there's some way to remove these things (e.g. RegisterPrintTransformer returning an IDisposable)

No RFC needed, it should just be done in vlsualfsharp repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment