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

Error when interpreting examples/reddit-haskell.ffg #34

Open
evanrelf opened this issue Feb 18, 2022 · 2 comments
Open

Error when interpreting examples/reddit-haskell.ffg #34

evanrelf opened this issue Feb 18, 2022 · 2 comments

Comments

@evanrelf
Copy link
Contributor

Everything here was run from 4d32d09. I get this error when trying to run the Reddit r/haskell example:

λ grace interpret examples/reddit-haskell.ffg
Unbound fields variable: b

examples/reddit-haskell.ffg:6:23:

6 │               { data: { children: List
  │                       ↑

I fiddled with this for quite a while, trying to narrow down what's going wrong. Here's a more minimal reproducing case which produces the same error:

λ cat bad.ffg
let bad = { a: 42 } : exists (etc : Fields) . { a: Natural, etc }

in  bad.a
λ grace interpret bad.ffg
Unbound fields variable: etc

bad.ffg:1:47:

1 │ let bad = { a: 42 } : exists (etc : Fields) . { a: Natural, etc }
  │                                                 ↑

When I stop trying to get the a field, and just get the whole thing back, it works:

 let bad = { a: 42 } : exists (etc : Fields) . { a: Natural, etc }

-in  bad.a
+in  bad
λ grace interpret bad.ffg
{ "a":
    42
}
@Gabriella439
Copy link
Owner

Gabriella439 commented Feb 24, 2022

Yeah, this is a known issue. I'm working on fixing it by implementing the algorithm from the Existential Crisis Resolved paper

@Gabriella439
Copy link
Owner

It looks like that this also needs to be combined with A Quick Look at Impredicativity

Specifically, in Grace we need impredicative existential quantification such as List (exists (a : Fields) . { x: Bool, a }). Fortunately, the "Existential Crisis Resolved" paper seems to explain how to integrate their work with the "A Quick Look at Impredicativity" paper

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