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

Scoping bug leading to a 'Fatal error' #250

Open
dorchard opened this issue Nov 22, 2024 · 0 comments
Open

Scoping bug leading to a 'Fatal error' #250

dorchard opened this issue Nov 22, 2024 · 0 comments

Comments

@dorchard
Copy link
Member

on main

data Cost (r : Q) a where
    MkCost : (() [r] -> a) -> Cost r a

return : forall {a : Type} . a -> Cost 0 a
return x = MkCost (\([()] : () [0]) -> x)

bind : forall {a b : Type, n m : Q} . (a -> Cost n b) -> Cost m a -> Cost (n + m) b
bind f (MkCost k) = MkCost (\([p] : (() [n + m])) -> let (MkCost k') = f (k [p]) in k' [p])

produces:

(base) dorchard@edud49c granule % gr thursday.gr 
Checking ex.gr...
Fatal error: ex.gr:
Looking up a variable '(Id "r.1" "r.1")' in [((Id "r.0" "r.0"),SFloat <symbolic> :: SFloat),((Id "r.2" "r.2"),SFloat <symbolic> :: SFloat),((Id "n" "n`2"),SFloat <symbolic> :: SFloat),((Id "m" "m`3"),SFloat <symbolic> :: SFloat)]
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

1 participant