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

Parse error in measure definition #2408

Open
amigalemming opened this issue Oct 24, 2024 · 0 comments
Open

Parse error in measure definition #2408

amigalemming opened this issue Oct 24, 2024 · 0 comments

Comments

@amigalemming
Copy link

I try to replicate measure definitions as in https://github.com/ucsd-progsys/liquidhaskell/blob/develop/tests/pos/Class2.hs .

{-@ class measure sz :: forall a. a -> Int  @-}
{-@ instance measure sz :: () -> Int
        sz () = 1
  @-}
{-@ instance measure sz :: Int -> Int
        sz n = n
  @-}

LiquidHaskell says:

src/Example/Size.hs:5:13: error:
    Cannot parse specification:
    unexpected ')'
    expecting '[', '_', dataConNameP, or lowercase letter
  |
5 |         sz () = 1
  |             ^

src/Example/Size.hs:8:12: error:
    Cannot parse specification:
    unexpected 'n'
    expecting measurePatP
  |
8 |         sz n = n
  |            ^

The examples define measures on user defined ADTs only. Are measures restricted to those?

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