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

toString #723

Closed
evancz opened this Issue Sep 22, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@evancz
Member

evancz commented Sep 22, 2016

Easy Problems

  • #472 - Adds parens around lists

Bad Input

  • #654 - Record with ctor field.
  • #645 - Json.Value with cyclical references
  • #539 - Json.Value with cyclical references (no http://sscce.org)
  • #812 - union types with particular names

The root problem here is that toString should return something like <js> when given a Json.Value of any kind. This can arise in a few situations.

Possible solution: reintroduce _ field to all records. This way it is clear when something is a union type or record or JSON value. You can still cheat, but it will be more rare. This has a cost in the size of all record allocations.

@evancz evancz added the meta label Sep 22, 2016

@elm elm locked and limited conversation to collaborators Sep 22, 2016

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 22, 2018

Member

#472 about parens should be fixed by elm-lang@b6b85af

The ctor thing should be solved by switching to $ for that name.

The JSON ones should be solved by the _Json_wrap and _Json_unwrap pattern, allowing me to show <internals> for all of those values.

I don't know if there is a fix for #812 at this time, but I'll wait til someone reopens something on it.

Member

evancz commented May 22, 2018

#472 about parens should be fixed by elm-lang@b6b85af

The ctor thing should be solved by switching to $ for that name.

The JSON ones should be solved by the _Json_wrap and _Json_unwrap pattern, allowing me to show <internals> for all of those values.

I don't know if there is a fix for #812 at this time, but I'll wait til someone reopens something on it.

@evancz evancz closed this May 22, 2018

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