Skip to content
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

Generic Fallbacks #51

Open
oxinabox opened this issue Sep 30, 2019 · 0 comments
Open

Generic Fallbacks #51

oxinabox opened this issue Sep 30, 2019 · 0 comments

Comments

@oxinabox
Copy link
Member

We should think about more on how we display things we don't have special overloads for.
the generric fallbacks.

I present two options:

ShowMime Option

#49 Which suggested the generic fallback for anything that is showable("img/png", ...)
should be to show it as an image in the image view.

And further my own desire that anything with showable for mimetype "text/plain" , "text/markdown", or "text/html" be displayed in the text view (which can render markdown/html); and that the ultimate fallback be to just showing (repring) like the ConsoleLogger does.

Destructure Option (current behavour)

This is mutually exclusive with our current fallback behavour of destructuring all structs.
E.g. to convert struct Foo a b end into showing a and showing b.
Which is also a good default.


One possibility to resolve this is to have wrapper types for one of the behavours.
So when logging something you want to have the particular behavour for, that does not agree with the default you wrap it in some indicator type.

I like the idea of making destructure a wrapper, and defaulting to the ShowMime option.
A particular advantage of this is one could use it to force destructurring on something we might have a default for. I guess something similar applies to show.
And later we might want to exend that, to be parameterized by how deep to destructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant