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

ddlog happily string-izes function references to unhelpful closure description #1063

Open
blp opened this issue Aug 27, 2021 · 4 comments
Open
Labels
bug Something isn't working Haskell Requires knowledge of Haskell

Comments

@blp
Copy link
Contributor

blp commented Aug 27, 2021

The following program:

function f(): string { "mystring" }
output relation X(x: string)
X("${f}").

yields this output:

X:
X{.x = "<closure: f, captured_args: ()>"}: +1

Of course, what I meant was:

function f(): string { "mystring" }
output relation X(x: string)
X("${f()}").

which outputs as expected:

X:
X{.x = "mystring"}: +1

I think that the compiler should be less willing to convert function references to strings this way.

@Kixiron Kixiron added bug Something isn't working Haskell Requires knowledge of Haskell labels Aug 27, 2021
@ryzhyk
Copy link
Contributor

ryzhyk commented Aug 27, 2021

This was meant as a useful debugging feature, but I can see how it is confusing.

@mihaibudiu
Copy link

Could be a warning

@Kixiron
Copy link
Contributor

Kixiron commented Aug 27, 2021

I don't think this should be implicit behavior at all, if anything it should be an explicitly-called method on functions

@ryzhyk
Copy link
Contributor

ryzhyk commented Aug 27, 2021

We can keep this behavior in debug printing (pring::debug() and ddlog_std::to_string_debug()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Haskell Requires knowledge of Haskell
Projects
None yet
Development

No branches or pull requests

4 participants