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 debug information for complex types #641

Open
farism opened this issue Sep 3, 2023 · 0 comments
Open

Improve debug information for complex types #641

farism opened this issue Sep 3, 2023 · 0 comments
Labels
discussion enhancement New feature or request language Language feature

Comments

@farism
Copy link
Contributor

farism commented Sep 3, 2023

It would be nice to preserve some of the debug information for complex types so that Debug.log would be more useful. This would only take effect when developing, not when doing a production (minified) bundle.

Some examples are below (generated names can be differnet)

record Point2D {
  x : Number,
  y : Number
}

component Main {
  fun foo {
    ""
  }

  fun componentDidMount {
    /*
    Prints `r {x:0, y:0}`

    It would be nice if this was `Point2D {x:0, y:0}`
    */
    Debug.log(Point2D(0, 0))

    /*
    Prints an object `AI {_0: 'hello world', length: 1}`

    It would be nice if it would print the as-is `Maybe::Just("hello world")`
    */
    Debug.log(Maybe::Just("hello world"))

    /*
    Prints `ƒ a() { return ''; }`

    It would be nice if this set the function name so it would print `ƒ foo() { return ''; }`
    */
    Debug.log(foo)
  }

  fun render : Html {
    <div/>
  }
}
@Sija Sija added enhancement New feature or request language Language feature discussion labels Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request language Language feature
Development

No branches or pull requests

2 participants