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

Variable ==> not in scope #1345

Open
jessebrennan opened this issue Jul 17, 2018 · 8 comments
Open

Variable ==> not in scope #1345

jessebrennan opened this issue Jul 17, 2018 · 8 comments

Comments

@jessebrennan
Copy link

While plugging in examples from the tutorial I got this error

$ liquid tutorial.hs 
LiquidHaskell Version 0.8.2.4, Git revision ec88f568d101bfd35b6254aa7db034164d9c89dd
Copyright 2013-18 Regents of the University of California. All Rights Reserved.


**** DONE:  annotate ***********************************************************
 

**** RESULT: ERROR *************************************************************


Invalid Source


 /home/jesse/projects/lh-tutorial/tutorial.hs:11:20-22: Error: GHC Error
  
 11 | ex4 a b = (a && b) ==> a
                         ^^^
  
     
         Variable not in scope: (==>) :: Bool -> Bool -> t

The contents of tutorial.hs:

{-@ type FALSE = {v:Bool | not v} @-}
{-@ type TRUE = {v:Bool | v} @-}

{-@ ex1 :: Bool -> TRUE @-}
ex1 b = b || not b

{-@ ex2 :: Bool -> FALSE @-}
ex2 b = b && not b

{-@ ex4 :: Bool -> Bool -> TRUE @-}
ex4 a b = (a && b) ==> a

{-@ ex5 :: Bool -> TRUE @-}
ex5 b = b || not b

ALSO

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2

I'm new to this, not really sure what is going wrong or what other info I can provide. What am I doing wrong? Thanks

@ranjitjhala
Copy link
Member

ranjitjhala commented Jul 17, 2018 via email

@ranjitjhala
Copy link
Member

ranjitjhala commented Jul 17, 2018 via email

@jessebrennan
Copy link
Author

I wouldn't mind doing a PR to clear up the docs here. As for the approach, do you think a better warning is sufficient or it would be worth while to add all of the 'hidden' bits to the docs? I haven't gotten very far into the tutorial (as you can tell) so I'm not completely sure what that would entail.

@ranjitjhala
Copy link
Member

Hmm, good question -- are you reading the docs online or on the PDF?

The easiest would be to just remove the \begin{comment} and \end{comment} lines, e.g.

so everything gets rendered...

@jessebrennan
Copy link
Author

I was reading online. As a side note, the online notes weren't working for me at home so I was using the PDF there.

@jessebrennan
Copy link
Author

The easiest would be to just remove the \begin{comment} and \end{comment} lines, e.g.

That makes sense to me. I would add some context / instructions too. Just give me the OK.

@jessebrennan
Copy link
Author

@ranjitjhala let me know if a PR to fix this would be appreciated.

@ranjitjhala
Copy link
Member

ranjitjhala commented Jul 19, 2018 via email

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