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

Improve appearance of nullary members in console logs #48

Open
OliverJAsh opened this issue Oct 28, 2022 · 1 comment
Open

Improve appearance of nullary members in console logs #48

OliverJAsh opened this issue Oct 28, 2022 · 1 comment

Comments

@OliverJAsh
Copy link
Member

I'm not sure if this is possible.

Currently nullary members appear as functions. It's difficult to view the contents (tag and value).

image

console.dir helps because it allows us to inspect properties on the function:

Screen.Recording.2022-10-28.at.11.42.51.mov
@samhh
Copy link
Member

samhh commented Oct 28, 2022

The most relevant issue is #44 and its fix #45. A less hacky solution would solve this but I couldn't think of anything else at the time that didn't have worse tradeoffs.

In Haskell-land you can't print without a Show instance. I know we're taking a similar approach on Web. It's not quite as ergonomic mind given the need to pass typeclass instances around.

It looks like we could do something like this on Node but I don't know about browsers:

> { [Symbol.for('nodejs.util.inspect.custom')]: () => 'foo' }
foo

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

2 participants