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

Unfriendly error with unspecified coeffect type + you can specify arbitrary vars for types #147

Open
GuiltyDolphin opened this issue Jul 10, 2020 · 0 comments
Labels

Comments

@GuiltyDolphin
Copy link
Member

On commit 6a38f01 (dev-minor).

With the following program (in a file prog.gr):

prog : forall a s. a [s] -> a [s]
prog t = t

I get the following error message:

Checking prog.gr...
Type checking failed: prog.gr:
Unbound type variable: prog.gr:2:1:
`_ks` is not quantified

Which ain't very friendly.

By using the debug option I was able to find that the program was interpreted as:

prog
  : forall {a`0 : _ka, s`1 : _ks} . a`0 [s`1] -> a`0 [s`1]
prog t`2 = t`2

So it's wanting me to specify a coeffect type, which I don't really want to do (implicit forall would be nice?).

But then I thought, hang on, what about that _ka? It didn't complain about that, so I tried the following:

prog : forall {a : ka, s : Nat} . a [s] -> a [s]
prog t = t

Which type-checks, which is concerning, because what is ka here??? And why is it treating "type variables" so different to grade variables?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant